Fix Removal Script Not Running

This commit is contained in:
zoicware
2025-05-26 14:38:08 -04:00
committed by GitHub
parent 0864295ed1
commit ae0198b2e9

View File

@@ -18,7 +18,7 @@ function Run-Trusted([String]$command) {
sc.exe start TrustedInstaller | Out-Null sc.exe start TrustedInstaller | Out-Null
#set bin back to default #set bin back to default
sc.exe config TrustedInstaller binpath= "`"$DefaultBinPath`"" | Out-Null sc.exe config TrustedInstaller binpath= "`"$DefaultBinPath`"" | Out-Null
# Stop-Service -Name TrustedInstaller -Force -ErrorAction SilentlyContinue Stop-Service -Name TrustedInstaller -Force -ErrorAction SilentlyContinue
} }
@@ -236,7 +236,8 @@ foreach ($choice in $aipackages) {
} }
'@ '@
Set-Content -Path $packageRemovalPath -Value $code -Force Set-Content -Path $packageRemovalPath -Value $code -Force
#allow removal script to run
Set-ExecutionPolicy Unrestricted -Force
Write-Status -msg 'Removing AI Appx Packages...' Write-Status -msg 'Removing AI Appx Packages...'
$command = "&$env:TEMP\aiPackageRemoval.ps1" $command = "&$env:TEMP\aiPackageRemoval.ps1"
Run-Trusted -command $command Run-Trusted -command $command