Skip to content

Commit 103cfbd

Browse files
committed
https://github.com/Microsoft/windows-dev-box-setup-scripts/issues/53
2 parents 0316142 + ed16e09 commit 103cfbd

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

scripts/RemoveDefaultApps.ps1

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ Write-Host "Uninstall unecessary applications that come with Windows out of the
88
# https://gist.github.com/alirobe/7f3b34ad89a159e6daa1
99
# https://github.com/W4RH4WK/Debloat-Windows-10/blob/master/scripts/remove-default-apps.ps1
1010

11+
function removeApp {
12+
Param ([string]$appName)
13+
Write-Output "Trying to remove $appName"
14+
Get-AppxPackage $appName -AllUsers | Remove-AppxPackage
15+
Get-AppXProvisionedPackage -Online | Where DisplayNam -like $appName | Remove-AppxProvisionedPackage -Online
16+
}
1117

1218
$applicationList = @(
1319
"Microsoft.BingFinance"
@@ -58,11 +64,4 @@ $applicationList = @(
5864

5965
foreach ($app in $applicationList) {
6066
removeApp $app
61-
}
62-
63-
function removeApp {
64-
Param ([string]$appName)
65-
Write-Output "Trying to remove $appName"
66-
Get-AppxPackage $appName -AllUsers | Remove-AppxPackage
67-
Get-AppXProvisionedPackage -Online | Where DisplayNam -like $appName | Remove-AppxProvisionedPackage -Online
6867
}

0 commit comments

Comments
 (0)