Skip to content

Instantly share code, notes, and snippets.

@happyincent
Created October 23, 2019 15:57
Show Gist options
  • Save happyincent/1cb6fc198555d433649af058c4b32a51 to your computer and use it in GitHub Desktop.
Save happyincent/1cb6fc198555d433649af058c4b32a51 to your computer and use it in GitHub Desktop.
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }
Get-AppxPackage -AllUsers | where-object {
$_.name -notlike "*Store*" -And
$_.name -notlike "*Calculator*" -And
$_.name -notlike "*ScreenSketch*"
} | Remove-AppxPackage
Write-Host -NoNewLine 'Press any key to continue...';
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment