### Execute RemoveWindowsAI Script from GitHub Source: https://context7.com/zoicware/removewindowsai/llms.txt These examples demonstrate how to download and execute the main RemoveWindowsAI PowerShell script directly from GitHub using various command-line options. The script can be run in non-interactive mode with all or specific options, with backup mode enabled, or to revert changes. ```powershell & ([scriptblock]::Create((irm "https://raw.githubusercontent.com/zoicware/RemoveWindowsAI/main/RemoveWindowsAi.ps1"))) -nonInteractive -AllOptions ``` ```powershell & ([scriptblock]::Create((irm "https://raw.githubusercontent.com/zoicware/RemoveWindowsAI/main/RemoveWindowsAi.ps1"))) -nonInteractive -Options DisableRegKeys,RemoveAppxPackages,RemoveCBSPackages ``` ```powershell & ([scriptblock]::Create((irm "https://raw.githubusercontent.com/zoicware/RemoveWindowsAI/main/RemoveWindowsAi.ps1"))) -nonInteractive -backupMode -AllOptions ``` ```powershell & ([scriptblock]::Create((irm "https://raw.githubusercontent.com/zoicware/RemoveWindowsAI/main/RemoveWindowsAi.ps1"))) -nonInteractive -revertMode -AllOptions ``` ```powershell & ([scriptblock]::Create((irm "https://raw.githubusercontent.com/zoicware/RemoveWindowsAI/main/RemoveWindowsAi.ps1"))) ``` ```powershell & ([scriptblock]::Create((irm 'https://kutt.it/RWAI'))) ``` -------------------------------- ### Prevent AI Package Reinstallation with PowerShell Source: https://context7.com/zoicware/removewindowsai/llms.txt This script installs a custom Windows Update package to prevent AI components from being reinstalled. It detects the system's CPU architecture (amd64 or arm64) and attempts to install a local CAB file if available. If not, it downloads the package from a GitHub repository. The script includes a fallback mechanism using DISM for PowerShell 7 compatibility. ```powershell function Install-NOAIPackage { # Detect CPU architecture $arm = ((Get-CimInstance -Class Win32_ComputerSystem).SystemType -match 'ARM64') -or ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') $arch = if ($arm) { 'arm64' } else { 'amd64' } # Add custom certificate to trusted root $certRegPath = 'HKLM:\Software\Microsoft\SystemCertificates\ROOT\Certificates\8A334AA8052DD244A647306A76B8178FA215F344' if (!(Test-Path "$certRegPath")) { New-Item -Path "$certRegPath" -Force | Out-Null } # Check if script is running locally with included packages if ((Test-Path "$PSScriptRoot\RemoveWindowsAIPackage\amd64") -and (Test-Path "$PSScriptRoot\RemoveWindowsAIPackage\arm64")) { Write-Status -msg 'Installing RemoveWindowsAI Package...' try { Add-WindowsPackage -Online ` -PackagePath "$PSScriptRoot\RemoveWindowsAIPackage\$arch\ZoicwareRemoveWindowsAI-$($arch)1.0.0.0.cab" ` -NoRestart -IgnoreCheck -ErrorAction Stop } catch { # Fallback to DISM for PowerShell 7 dism.exe /Online /Add-Package ` /PackagePath:"$PSScriptRoot\RemoveWindowsAIPackage\$arch\ZoicwareRemoveWindowsAI-$($arch)1.0.0.0.cab" ` /NoRestart /IgnoreCheck } } else { # Download package from GitHub Write-Status -msg 'Downloading RemoveWindowsAI Package From Github...' $ProgressPreference = 'SilentlyContinue' try { Invoke-WebRequest ` -Uri "https://github.com/zoicware/RemoveWindowsAI/raw/refs/heads/main/RemoveWindowsAIPackage/$arch/ZoicwareRemoveWindowsAI-$($arch)1.0.0.0.cab" ` -OutFile "$env:TEMP\ZoicwareRemoveWindowsAI-$($arch)1.0.0.0.cab" ` -UseBasicParsing -ErrorAction Stop Add-WindowsPackage -Online ` -PackagePath "$env:TEMP\ZoicwareRemoveWindowsAI-$($arch)1.0.0.0.cab" ` -NoRestart -IgnoreCheck -ErrorAction Stop } catch { Write-Status -msg "Unable to Download Package" -errorOutput $true } } } ``` -------------------------------- ### PowerShell Privilege Escalation with TrustedInstaller Source: https://context7.com/zoicware/removewindowsai/llms.txt This PowerShell function, Run-Trusted, escalates privileges to SYSTEM by temporarily hijacking the TrustedInstaller service. It stops the service, reconfigures it to run a provided command, starts it, and then restores the original configuration. It handles potential errors and ensures the command is executed with elevated permissions. ```powershell function Run-Trusted([String]$command, $psversion) { if ($psversion -eq 7) { $psexe = 'pwsh.exe' } else { $psexe = 'PowerShell.exe' } try { Stop-Service -Name TrustedInstaller -Force -ErrorAction Stop -WarningAction Stop } catch { taskkill /im trustedinstaller.exe /f >$null } $service = Get-CimInstance -ClassName Win32_Service -Filter "Name='TrustedInstaller'" $DefaultBinPath = $service.PathName $trustedInstallerPath = "$env:SystemRoot\servicing\TrustedInstaller.exe" # Convert command to base64 to avoid issues with spaces $bytes = [System.Text.Encoding]::Unicode.GetBytes($command) $base64Command = [Convert]::ToBase64String($bytes) # Temporarily modify service to execute our command sc.exe config TrustedInstaller binPath= "cmd.exe /c $psexe -encodedcommand $base64Command" | Out-Null sc.exe start TrustedInstaller | Out-Null # Restore original service configuration sc.exe config TrustedInstaller binpath= "`"$DefaultBinPath`"" | Out-Null try { Stop-Service -Name TrustedInstaller -Force -ErrorAction Stop -WarningAction Stop } catch { taskkill /im trustedinstaller.exe /f >$null } } ``` -------------------------------- ### Launch Remove Windows AI Script with UI (Shortened URL) (PowerShell) Source: https://github.com/zoicware/removewindowsai/blob/main/README.md This PowerShell command provides a shortened URL to launch the Remove Windows AI script with its UI. It's a more concise way to execute the same functionality as the direct URL method. As with the direct URL, ensure you are using Windows PowerShell (5.1). ```PowerShell & ([scriptblock]::Create((irm 'https://kutt.it/RWAI'))) ``` -------------------------------- ### Remove AI Component Store Packages with DISM Fallback Source: https://context7.com/zoicware/removewindowsai/llms.txt This function cleans the Windows Component Store by removing hidden AI-related packages. It first attempts to make packages visible and removable, then removes them using PowerShell cmdlets. If that fails, it falls back to using DISM for compatibility with PowerShell 7. Dependencies include PowerShell and administrative privileges. ```powershell function Remove-AI-CBS-Packages { Write-Status -msg 'Removing Additional Hidden AI Packages...' $regPath = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages' $ProgressPreference = 'SilentlyContinue' Get-ChildItem $regPath | ForEach-Object { $value = try { Get-ItemPropertyValue "registry::$($_.Name)" -Name Visibility -ErrorAction Stop } catch { $null } # Check if package is hidden and AI-related if ($value -eq 2 -and ($_.PSChildName -like '*AIX*' -or $_.PSChildName -like '*Recall*' -or $_.PSChildName -like '*Copilot*' -or $_.PSChildName -like '*CoreAI*')) { # Make package visible and removable Set-ItemProperty "registry::$($_.Name)" -Name Visibility -Value 1 -Force New-ItemProperty "registry::$($_.Name)" -Name DefVis -PropertyType DWord -Value 2 -Force # Remove ownership restrictions Remove-Item "registry::$($_.Name)\Owners" -Force -ErrorAction SilentlyContinue Remove-Item "registry::$($_.Name)\Updates" -Force -ErrorAction SilentlyContinue try { # Remove the package Remove-WindowsPackage -Online -PackageName $_.PSChildName -NoRestart -ErrorAction Stop *>$null # Clean up leftover package files $paths = Get-ChildItem "$env:windir\servicing\Packages" -Filter "*$($_.PSChildName)*" -ErrorAction SilentlyContinue foreach ($path in $paths) { if ($path) { Remove-Item $path.FullName -Force -ErrorAction SilentlyContinue } } } catch { # Fallback to DISM for PowerShell 7 compatibility dism.exe /Online /Remove-Package /PackageName:$($_.PSChildName) /NoRestart /Quiet } } } } ``` -------------------------------- ### Remove AI AppX Packages with TrustedInstaller Privileges Source: https://context7.com/zoicware/removewindowsai/llms.txt This function removes AI-related AppX packages by creating and executing a script with TrustedInstaller privileges. It marks packages for deprovisioning, removal, and prevents reinstallation via Windows Update by modifying registry policies. Dependencies include PowerShell and administrative privileges. ```powershell function Remove-AI-Appx-Packages { $aipackages = @( 'MicrosoftWindows.Client.AIX' 'MicrosoftWindows.Client.CoPilot' 'Microsoft.Windows.Ai.Copilot.Provider' 'Microsoft.Copilot' 'MicrosoftWindows.Client.CoreAI' 'Microsoft.Edge.GameAssist' 'Microsoft.Office.ActionsServer' 'WindowsWorkload.Data.Analysis.Stx.*' 'WindowsWorkload.Manager.*' 'WindowsWorkload.ImageSearch.Stx.*' ) # Create removal script to run with TrustedInstaller privileges $code = @' $store = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore' $users = @('S-1-5-18'); if (test-path $store) { $users += $((Get-ChildItem $store -ea 0 | Where-Object { $_ -like '*S-1-5-21*' }).PSChildName) } foreach ($choice in $aipackages) { foreach ($appx in $(get-appxprovisionedpackage -online | Where-Object { $_.PackageName -like "*$choice*" })) { $PackageName = $appx.PackageName $PackageFamilyName = ($appxpackage | Where-Object { $_.Name -eq $appx.DisplayName }).PackageFamilyName # Mark as deprovisioned to prevent reinstallation New-Item "$store\Deprovisioned\$PackageFamilyName" -force # Remove non-removable flag Set-NonRemovableAppsPolicy -Online -PackageFamilyName $PackageFamilyName -NonRemovable 0 # Mark as end-of-life for all users foreach ($sid in $users) { New-Item "$store\EndOfLife\$sid\$PackageName" -force } # Remove provisioned package remove-appxprovisionedpackage -packagename $PackageName -online -allusers } } '@ Set-Content -Path "$env:TEMP\aiPackageRemoval.ps1" -Value $code -Force # Execute with SYSTEM privileges $command = "&$env:TEMP\aiPackageRemoval.ps1" Run-Trusted -command $command -psversion $psversion # Prevent Windows Update from reinstalling Copilot Reg.exe add 'HKLM\SOFTWARE\Policies\Microsoft\Windows\Appx\RemoveDefaultMicrosoftStorePackages' /v 'Enabled' /t REG_DWORD /d 1 /f *>$null Reg.exe add 'HKLM\SOFTWARE\Policies\Microsoft\Windows\Appx\RemoveDefaultMicrosoftStorePackages\Microsoft.Copilot_8wekyb3d8bbwe' /v 'RemovePackage' /t REG_DWORD /d 1 /f *>$null } ``` -------------------------------- ### Launch Remove Windows AI Script with UI (PowerShell) Source: https://github.com/zoicware/removewindowsai/blob/main/README.md This PowerShell command launches the Remove Windows AI script with its graphical user interface. It fetches the script from a remote URL and executes it. Ensure you are running Windows PowerShell (5.1) and not PowerShell 7 to avoid potential issues. ```PowerShell & ([scriptblock]::Create((irm "https://raw.githubusercontent.com/zoicware/RemoveWindowsAI/main/RemoveWindowsAi.ps1"))) ``` -------------------------------- ### Run Remove Windows AI Script with Backup Mode Enabled (PowerShell) Source: https://github.com/zoicware/removewindowsai/blob/main/README.md This PowerShell command executes the Remove Windows AI script with backup mode enabled. Backup mode is crucial for creating a restore point, allowing you to revert the changes made by the script if necessary. It applies all options in a non-interactive manner. ```PowerShell & ([scriptblock]::Create((irm "https://raw.githubusercontent.com/zoicware/RemoveWindowsAI/main/RemoveWindowsAi.ps1"))) -nonInteractive -backupMode -AllOptions ``` -------------------------------- ### Disable Copilot Policies with PowerShell Source: https://context7.com/zoicware/removewindowsai/llms.txt This script modifies the IntegratedServicesRegionPolicySet.json file to disable Copilot and Recall features. It requires administrative privileges to take ownership and modify the system file. The script targets specific policy comments within the JSON and sets their default state to 'disabled' or 'enabled' as appropriate. ```powershell function Disable-Copilot-Policies { $JSONPath = "$env:windir\System32\IntegratedServicesRegionPolicySet.json" if (Test-Path $JSONPath) { Write-Host "Disabling CoPilot Policies in [$JSONPath]" -ForegroundColor Cyan # Take ownership of policy file takeown /f $JSONPath *>$null icacls $JSONPath /grant *S-1-5-32-544:F /t *>$null # Modify policy JSON $jsonContent = Get-Content $JSONPath | ConvertFrom-Json try { # Disable all Copilot-related policies $copilotPolicies = $jsonContent.policies | Where-Object { $_.'$comment' -like '*CoPilot*' } foreach ($policies in $copilotPolicies) { $policies.defaultState = 'disabled' } # Disable Recall and Settings Agent policies $recallPolicies = $jsonContent.policies | Where-Object { $_.'$comment' -like '*A9*' -or $_.'$comment' -like '*Manage Recall*' -or $_.'$comment' -like '*Settings Agent*' } foreach ($recallPolicy in $recallPolicies) { if ($recallPolicy.'$comment' -like '*A9*') { $recallPolicy.defaultState = 'enabled' # Enable A9 homepage disabling } elseif ($recallPolicy.'$comment' -like '*Manage Recall*') { $recallPolicy.defaultState = 'disabled' } elseif ($recallPolicy.'$comment' -like '*Settings Agent*') { $recallPolicy.defaultState = 'enabled' # Enable agent disabling } } # Save modified JSON $newJSONContent = $jsonContent | ConvertTo-Json -Depth 100 Set-Content $JSONPath -Value $newJSONContent -Force $total = ($copilotPolicies.count) + ($recallPolicies.count) Write-Status -msg "$total CoPilot Policies Disabled" } catch { Write-Status -msg 'CoPilot Not Found in IntegratedServicesRegionPolicySet' -errorOutput $true } } } ``` -------------------------------- ### PowerShell System-Wide AI Feature Disabling via Registry Source: https://context7.com/zoicware/removewindowsai/llms.txt This PowerShell function, Disable-Registry-Keys, disables various Windows AI features, including Copilot and Recall, by modifying system-wide registry keys. It targets both HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER hives, applying specific DWORD values to disable features and then forces a Group Policy update to apply the changes. ```powershell function Disable-Registry-Keys { Write-Status -msg "$(@('Disabling', 'Enabling')[$revert]) Copilot and Recall..." # Delete Windows AI configuration to prevent automatic installation Reg.exe delete 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsAI\LastConfiguration' /f *>$null $hives = @('HKLM', 'HKCU') foreach ($hive in $hives) { # Disable Copilot Reg.exe add "$hive\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot" /v 'TurnOffWindowsCopilot' /t REG_DWORD /d 1 /f *>$null # Disable Windows AI data analysis Reg.exe add "$hive\SOFTWARE\Policies\Microsoft\Windows\WindowsAI" /v 'DisableAIDataAnalysis' /t REG_DWORD /d 1 /f *>$null # Disable Recall enablement Reg.exe add "$hive\SOFTWARE\Policies\Microsoft\Windows\WindowsAI" /v 'AllowRecallEnablement' /t REG_DWORD /d 0 /f *>$null # Disable Click to Do AI feature Reg.exe add "$hive\SOFTWARE\Policies\Microsoft\Windows\WindowsAI" /v 'DisableClickToDo' /t REG_DWORD /d 1 /f *>$null # Disable snapshot saving for Recall Reg.exe add "$hive\SOFTWARE\Policies\Microsoft\Windows\WindowsAI" /v 'TurnOffSavingSnapshots' /t REG_DWORD /d 1 /f *>$null } # Disable Copilot button in taskbar Reg.exe add 'HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' /v 'ShowCopilotButton' /t REG_DWORD /d 0 /f *>$null # Disable input insights and typing data collection Reg.exe add 'HKCU\Software\Microsoft\input\Settings' /v 'InsightsEnabled' /t REG_DWORD /d 0 /f *>$null # Apply changes gpupdate /force /wait:0 >$null } ``` -------------------------------- ### Remove Recall Scheduled Tasks with System Privileges Source: https://context7.com/zoicware/removewindowsai/llms.txt This PowerShell function forcefully removes Recall's scheduled tasks by running a script with SYSTEM privileges. It disables scheduled tasks, removes associated files and registry entries, and ensures thorough cleanup. ```powershell function Remove-Recall-Tasks { Write-Status -msg 'Removing Recall Scheduled Tasks...' # Create script to run with TrustedInstaller $code = @" Get-ScheduledTask -TaskPath "*Recall*" | Disable-ScheduledTask -ErrorAction SilentlyContinue Remove-Item "`$env:Systemroot\System32\Tasks\Microsoft\Windows\WindowsAI" -Recurse -Force -ErrorAction SilentlyContinue `$initConfigID = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\WindowsAI\Recall\InitialConfiguration" -Name 'Id' `$policyConfigID = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\WindowsAI\Recall\PolicyConfiguration" -Name 'Id' if(`$initConfigID -and `$policyConfigID){ Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks`$initConfigID" -Recurse -Force -ErrorAction SilentlyContinue Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks`$policyConfigID" -Recurse -Force -ErrorAction SilentlyContinue } Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft\Windows\WindowsAI" -Force -Recurse -ErrorAction SilentlyContinue "@ $subScript = "$env:TEMP\RemoveRecallTasks.ps1" New-Item $subScript -Force | Out-Null Set-Content $subScript -Value $code -Force $command = "&$subScript" Run-Trusted -command $command -psversion $psversion Start-Sleep 1 } ``` -------------------------------- ### Run Remove Windows AI Script with Specific Options (PowerShell) Source: https://github.com/zoicware/removewindowsai/blob/main/README.md This PowerShell command allows you to run the Remove Windows AI script in non-interactive mode with a selection of specific options. You can choose which AI components to disable or remove by listing them after the '-Options' parameter. Requires administrator privileges. ```PowerShell & ([scriptblock]::Create((irm "https://raw.githubusercontent.com/zoicware/RemoveWindowsAI/main/RemoveWindowsAi.ps1"))) -nonInteractive -Options DisableRegKeys,RemoveNudgesKeys,RemoveAppxPackages ``` -------------------------------- ### Revert Changes Made by Remove Windows AI Script (PowerShell) Source: https://github.com/zoicware/removewindowsai/blob/main/README.md This PowerShell command reverts all changes made by the Remove Windows AI script. It requires that backup mode was enabled during the initial script execution. This command ensures a clean rollback of all AI-related modifications. ```PowerShell & ([scriptblock]::Create((irm "https://raw.githubusercontent.com/zoicware/RemoveWindowsAI/main/RemoveWindowsAi.ps1"))) -nonInteractive -revertMode -AllOptions ``` -------------------------------- ### Run Remove Windows AI Script in Non-Interactive Mode (PowerShell) Source: https://github.com/zoicware/removewindowsai/blob/main/README.md This PowerShell command executes the Remove Windows AI script in non-interactive mode, applying all available options. This is useful for automated deployments or when you want to disable all AI features without user intervention. Requires administrator privileges. ```PowerShell & ([scriptblock]::Create((irm "https://raw.githubusercontent.com/zoicware/RemoveWindowsAI/main/RemoveWindowsAi.ps1"))) -nonInteractive -AllOptions ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.