Created
January 20, 2021 10:09
-
-
Save BastienM/abdacad4ead74a8af543e1bcc5b0b662 to your computer and use it in GitHub Desktop.
Simple Powershell script to clean up Microsoft apps and install your own with Chocolatey
This file contains hidden or 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
#Requires -RunAsAdministrator | |
$installApplications = @( | |
"adb" | |
"aimp" | |
"authy-desktop" | |
"bitwarden" | |
"blackbird" | |
"chocolateygui" | |
"chromium" | |
"cpu-z" | |
"discord" | |
"eac" | |
"epicgameslauncher" | |
"firefox" | |
"foxitreader" | |
"gpu-z" | |
"handbrake" | |
"hwmonitor" | |
"infekt" | |
"k-litecodecpackfull" | |
"logitechgaming" | |
"makemkv" | |
"malwarebytes" | |
"mediainfo" | |
"microsoft-windows-terminal" | |
"mkvtoolnix" | |
"musicbee" | |
"nextcloud-client" | |
"notable" | |
"pdfsam.install" | |
"peazip" | |
"picard" | |
"plex" | |
"plexamp" | |
"rufus" | |
"samsung-magician" | |
"slack" | |
"steam-cleaner" | |
"steam" | |
"twitch" | |
"uplay" | |
"vscodium" | |
"whatsapp" | |
"wsl-alpine" | |
) | |
$uninstallApplications = @( | |
"Microsoft.BingFinance" | |
"Microsoft.3DBuilder" | |
"Microsoft.BingFinance" | |
"Microsoft.BingNews" | |
"Microsoft.BingSports" | |
"Microsoft.BingWeather" | |
"Microsoft.CommsPhone" | |
"Microsoft.Getstarted" | |
"Microsoft.WindowsMaps" | |
"*MarchofEmpires*" | |
"Microsoft.GetHelp" | |
"Microsoft.Messaging" | |
"*Minecraft*" | |
"Microsoft.MicrosoftOfficeHub" | |
"Microsoft.OneConnect" | |
"Microsoft.WindowsPhone" | |
"Microsoft.WindowsSoundRecorder" | |
"*Solitaire*" | |
"Microsoft.MicrosoftStickyNotes" | |
"Microsoft.Office.Sway" | |
"Microsoft.XboxApp" | |
"Microsoft.XboxIdentityProvider" | |
"Microsoft.ZuneMusic" | |
"Microsoft.ZuneVideo" | |
"Microsoft.NetworkSpeedTest" | |
"Microsoft.FreshPaint" | |
"Microsoft.Print3D" | |
"*Autodesk*" | |
"*BubbleWitch*" | |
"king.com*" | |
"G5*" | |
"*Dell*" | |
"*Facebook*" | |
"*Keeper*" | |
"*Netflix*" | |
"*Twitter*" | |
"*Plex*" | |
"*.Duolingo-LearnLanguagesforFree" | |
"*.EclipseManager" | |
"ActiproSoftwareLLC.562882FEEB491" # Code Writer | |
"*.AdobePhotoshopExpress" | |
); | |
function installChoco { | |
Set-ExecutionPolicy Bypass -Scope Process -Force; ` | |
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
} | |
function removeApp { | |
Param ([string]$appName) | |
Write-Output "Removing $appName" | |
Get-AppxPackage $appName -AllUsers | Remove-AppxPackage | |
Get-AppXProvisionedPackage -Online | Where-Object DisplayName -like $appName | Remove-AppxProvisionedPackage -Online | |
} | |
function addApp { | |
Param ([string]$appName) | |
Write-Output "Installing $appName" | |
choco install $appName -y | |
} | |
Disable-UAC | |
# Explorer configuration | |
Write-Output "Enabling Explorer to show file extensions" | |
Set-WindowsExplorerOptions -EnableShowFileExtensions | |
Write-Output "Installing Chocolatey" | |
installChocolatey | |
RefreshEnv | |
# WSL configuration | |
Write-Output "Enabling WSL" | |
choco install -y Microsoft-Windows-Subsystem-Linux --source="'windowsfeatures'" | |
foreach ($app in $uninstallApplications) { | |
removeApp $app | |
} | |
foreach ($app in $installApplications) { | |
addApp $app | |
} | |
Enable-UAC | |
Enable-MicrosoftUpdate | |
Install-WindowsUpdate -acceptEula |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment