Skip to content

Commit

Permalink
Add Remove-Win10-Apps.ps1
Browse files Browse the repository at this point in the history
Adds script that will remove pre-installed appx-packages both provisioned for new users and the ones already installed for existing users.
  • Loading branch information
krisdb2009 committed Jul 18, 2019
1 parent 1429296 commit c531cbb
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions Desktop/Remove-Win10-Apps.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Write-Progress -Activity "Remove Apps" -Status "Looking for apps to remove..." -PercentComplete 0

$PackagesToRemove =
"Microsoft.3DBuilder",
"Microsoft.Microsoft3DViewer",
"Microsoft.BingFinance",
"Microsoft.BingNews",
"Microsoft.BingSports",
"Microsoft.BingTranslator",
"Microsoft.CommsPhone",
"Microsoft.Getstarted",
"Microsoft.Messaging",
"Microsoft.MicrosoftOfficeHub",
"Microsoft.MicrosoftSolitaireCollection",
"Microsoft.Office.OneNote",
"Microsoft.Office.Sway",
"Microsoft.SkypeApp",
"Microsoft.People",
"Microsoft.WindowsAlarms",
"Microsoft.WindowsCamera",
"Microsoft.WindowsCommunicationsApps",
"Microsoft.WindowsMaps",
"Microsoft.WindowsPhone",
"Microsoft.WindowsSoundRecorder",
"Microsoft.XboxApp",
"Microsoft.ZuneMusic",
"Microsoft.ZuneVideo",
"Microsoft.OneConnect",
"Microsoft.WindowsFeedbackHub"

$ProvisionPackagesToRemove = @()
$AllUserPackagesToRemove = @()

foreach($ProvisionedPackage in Get-AppxProvisionedPackage -Online) {
foreach($PackageToRemove in $PackagesToRemove) {
if($ProvisionedPackage.PackageName.Contains($PackageToRemove)) {
$ProvisionPackagesToRemove += $ProvisionedPackage
}
}
}

foreach($AllUserPackage in Get-AppxPackage -AllUsers) {
foreach($PackageToRemove in $PackagesToRemove) {
if($AllUserPackage.PackageFullName.Contains($PackageToRemove)) {
$AllUserPackagesToRemove += $AllUserPackage
}
}
}

$Total = $ProvisionPackagesToRemove.Count + $AllUserPackagesToRemove.Count
$Progress = 0

foreach($ProvisionedPackage in $ProvisionPackagesToRemove) {
Write-Progress -Activity "Remove Apps" -Status ("Removing Provisioned App: " + $ProvisionedPackage.PackageName + "...") -PercentComplete (($Progress++ / $Total) * 100)
$ProvisionedPackage | Remove-AppxProvisionedPackage -Online
}

foreach($AllUserPackage in $AllUserPackagesToRemove) {
Write-Progress -Activity "Remove Apps" -Status ("Removing AllUsers App: " + $AllUserPackage.Name + "...") -PercentComplete (($Progress++ / $Total) * 100)
$AllUserPackage | Remove-AppxPackage -AllUsers
}

0 comments on commit c531cbb

Please sign in to comment.