Created
March 25, 2024 17:28
-
-
Save TheDayIsMyEnemy/ea07e289aa1248ff24e4b8b0a7c491ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$programsToRemove = @( | |
"OneDrive", | |
"Microsoft.MicrosoftEdge", | |
"Microsoft.WindowsStore", | |
"Microsoft.Messaging", | |
"Microsoft.WindowsFeedbackHub", | |
"Microsoft.GetHelp", | |
"Microsoft.ZuneMusic", | |
"Microsoft.MicrosoftSolitaireCollection", | |
"Microsoft.MicrosoftStickyNotes", | |
"Microsoft.Windows.Photos", | |
"Microsoft.MicrosoftOfficeHub", | |
"Microsoft.Microsoft3DViewer", | |
"Microsoft.MicrosoftPeople", | |
"Microsoft.SkypeApp", | |
"Microsoft.MicrosoftEdgeDevToolsClient", | |
"Microsoft.Windows.Photos", | |
"Microsoft.MicrosoftEdge.Stable", | |
"Microsoft.Xbox.TCUI", | |
"Microsoft.MicrosoftWhiteboard", | |
"Microsoft.WindowsCalculator", | |
"Microsoft.WindowsAlarms", | |
"Microsoft.XboxGameCallableUI" | |
) | |
foreach ($program in $programsToRemove) { | |
# Try to uninstall the program as an appx package | |
Write-Host "Attempting to uninstall app: $program" | |
Get-AppxPackage -AllUsers | Where-Object {$_.Name -eq $program} | Remove-AppxPackage -ErrorAction SilentlyContinue | |
# Disable the program if it's a system application | |
Write-Host "Attempting to disable system application: $program" | |
Get-AppxProvisionedPackage -Online | Where-Object {$_.DisplayName -eq $program} | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue | |
} | |
# Disable Cortana | |
Write-Host "Disabling Cortana..." | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -Value 0 -Force | |
Write-Host "Script execution complete." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment