diff --git a/RemoveWindowsAi.ps1 b/RemoveWindowsAi.ps1 index 6a9d64e..a3d07c6 100644 --- a/RemoveWindowsAi.ps1 +++ b/RemoveWindowsAi.ps1 @@ -14,6 +14,11 @@ function Run-Trusted([String]$command) { #get bin path to revert later $service = Get-WmiObject -Class Win32_Service -Filter "Name='TrustedInstaller'" $DefaultBinPath = $service.PathName + #make sure path is valid and the correct location + $trustedInstallerPath = "$env:SystemRoot\servicing\TrustedInstaller.exe" + if($DefaultBinPath -ne $trustedInstallerPath){ + $DefaultBinPath = $trustedInstallerPath + } #convert command to base64 to avoid errors with spaces $bytes = [System.Text.Encoding]::Unicode.GetBytes($command) $base64Command = [Convert]::ToBase64String($bytes)