-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathRemove-Appx_Detection.ps1
39 lines (33 loc) · 1015 Bytes
/
Remove-Appx_Detection.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
Begin {
$BlackListedApps = New-Object -TypeName System.Collections.ArrayList
$BlackListedApps.AddRange(@(
"Microsoft.GetHelp",
"Microsoft.GetStarted",
"Microsoft.MicrosoftOfficeHub",
"Microsoft.MixedReality.Portal",
"Microsoft.SkypeApp",
"Microsoft.WindowsFeedbackHub",
"Microsoft.XboxApp",
"Microsoft.XboxGameOverlay",
"Microsoft.XboxGamingOverlay",
"Microsoft.YourPhone",
"Microsoft.ZuneMusic",
"Microsoft.ZuneVideo"
))
}
Process {
$AppArrayList = Get-AppxProvisionedPackage -Online | Select-Object -ExpandProperty DisplayName
foreach ($App in $AppArrayList) {
if (($App -in $BlackListedApps)) {
$AppExists = $True
}
}
If ($AppExists) {
Write-Output "All appx packages were not removed"
Exit 1
}
else {
Write-Output "All appx packages were removed"
Exit 0
}
}