# Self-elevate script if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) Start-Process powershell.exe -ArgumentList "-File `"$PSCommandPath`"" -Verb RunAs exit
function Install-MSIXBundle try Write-Log "Starting MSIX bundle installation: $BundlePath" msixbundle install powershell
Write-Host "Checking bundle integrity..." -ForegroundColor Cyan $hash = Get-FileHash -Path $bundlePath -Algorithm SHA256 Write-Host "Bundle hash: $($hash.Hash)" try Write-Host "Installing bundle..." -ForegroundColor Cyan $result = Add-AppxPackage -Path $bundlePath -ErrorAction Stop -Verbose # Self-elevate script if (-NOT ([Security
catch Write-Host "❌ Installation failed: $_" -ForegroundColor Red msixbundle install powershell