-
Notifications
You must be signed in to change notification settings - Fork 4
/
ProvisionWindow10.ps1
50 lines (45 loc) · 1.46 KB
/
ProvisionWindow10.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
[CmdletBinding()]
Param()
function ProvisionWindows10{
[CmdletBinding()]
$PackageRemoveList = @(
'Microsoft.BingFinance_*'
'Microsoft.BingNews_*'
'Microsoft.BingSport_*'
'Microsoft.BingWeather_*'
'Microsoft.DesktopAppInstaller_*'
'Microsoft.Getstarted_*'
'Microsoft.Messaging_*'
'Microsoft.MicrosoftOfficeHub_*'
'Microsoft.MicrosoftSolitaireCollection_*'
'Microsoft.MicrosoftStickyNotes_*'
'Microsoft.OneConnect_*'
'Microsoft.People_*'
'Microsoft.SkypeApp_*'
'Microsoft.StorePurchaseApp_*'
'Microsoft.Wallet_*'
'Microsoft.Windows.Photos_*'
'Microsoft.WindowsCamera_*'
'Microsoft.WindowsCommunicationsApps_*'
'Microsoft.WindowsFeedbackHub_*'
'Microsoft.WindowsPhone_*'
'Microsoft.WindowsStore_*'
'Microsoft.Xbox*'
'Microsoft.Zune*'
)
$windowsPackages = Get-AppxProvisionedPackage -Online
$ObjectsForRemoval = foreach ($name in $windowsPackages.packagename) {
foreach($remove in $PackageRemoveList) {
if($name -like $remove){
$name
}
}
}
Write-verbose "Found $(write-output $ObjectsForRemoval.count) package(s) to remove."
foreach($n in $ObjectsForRemoval){
Write-verbose $n
Remove-AppxProvisionedPackage -Online -packagename $n
}
$ObjectsForRemoval | Remove-AppxPackage -AllUsers
}
ProvisionWindows10