From ae0198b2e990abe802d2051612fb69d3b849c06a Mon Sep 17 00:00:00 2001 From: zoicware <118035521+zoicware@users.noreply.github.com> Date: Mon, 26 May 2025 14:38:08 -0400 Subject: [PATCH] Fix Removal Script Not Running --- RemoveWindowsAi.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/RemoveWindowsAi.ps1 b/RemoveWindowsAi.ps1 index 20d8e7e..a1bb849 100644 --- a/RemoveWindowsAi.ps1 +++ b/RemoveWindowsAi.ps1 @@ -18,7 +18,7 @@ function Run-Trusted([String]$command) { sc.exe start TrustedInstaller | Out-Null #set bin back to default 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 - +#allow removal script to run +Set-ExecutionPolicy Unrestricted -Force Write-Status -msg 'Removing AI Appx Packages...' $command = "&$env:TEMP\aiPackageRemoval.ps1" Run-Trusted -command $command