Reworked disableModernShitty funciton to remove modern apps from AppxProvisionnedPackage

This commit is contained in:
Yorick 2016-09-08 17:21:50 +02:00
parent 67e348cb87
commit 43cfa8fa9d

View file

@ -110,7 +110,7 @@ function disableShitty {
try { try {
Dism /online /Disable-Feature /FeatureName:$name /NoRestart| Out-Null Dism /online /Disable-Feature /FeatureName:$name /NoRestart| Out-Null
} }
catch { catch {
Write-Host -ForegroundColor Red " Error" Write-Host -ForegroundColor Red " Error"
Return Return
} }
@ -128,7 +128,11 @@ function disableModernShitty {
param([string]$name) param([string]$name)
Write-Host -ForegroundColor white -NoNewline "Remove $name modern app" Write-Host -ForegroundColor white -NoNewline "Remove $name modern app"
try { try {
Get-AppxPackage -AllUsers -name *$name* | Remove-AppxPackage $pkgname = Get-AppxPackage -allusers -name *$name*
if (Get-AppxPackage $pkgname) {
Remove-AppxPackage $pkgname
}
Get-AppxProvisionedPackage -Online | where-Object {$_.PackageName -like "*$name*"} | Remove-AppxProvisionedPackage -Online | Out-Null
} }
catch { catch {
Write-Host -ForegroundColor Red " Error " Write-Host -ForegroundColor Red " Error "
@ -156,12 +160,12 @@ function disableShittyService ([string]$name){
Write-Output "" Write-Output ""
Write-Output "I's time to kick ass and chew bubble gum" Write-Output "I's time to kick ass and chew bubble gum"
Write-Output "________________________________________" Write-Output "________________________________________"
write-Output "" write-Output ""
$shittyFeatures | foreach { disableShitty $_ } $shittyFeatures | foreach { disableShitty $_ }
$shittyServices | Foreach { disableShittyService $_ } $shittyServices | Foreach { disableShittyService $_ }
$shittyModernApp | Foreach { disableModernShitty $_ } $shittyModernApp | Foreach { disableModernShitty $_ }
$shittyHosts | Foreach { blockShittyHost $HOST_FILE $HOST_IP $_ } $shittyHosts | Foreach { blockShittyHost $HOST_FILE $HOST_IP $_ }
remove_shittyTasks $shittyTasks remove_shittyTasks $shittyTasks
$shittyIP | Foreach { $shittyIP | Foreach {
@ -188,6 +192,6 @@ modifyShittyRegValue "HKLM:\SOFTWARE\Microsoft\Windows Defender\Spynet" "SpyNetR
# Windows Defender Sample Submission # Windows Defender Sample Submission
modifyShittyRegValue "HKLM:\SOFTWARE\Microsoft\Windows Defender\Spynet" "SubmitSamplesConsent" "0" modifyShittyRegValue "HKLM:\SOFTWARE\Microsoft\Windows Defender\Spynet" "SubmitSamplesConsent" "0"
#Désinstallation des applications "métro" inutiles #Désinstallation des applications "métro" inutiles
#Get-AppxPackage -AllUsers | Remove-AppxPackage #Get-AppxPackage -AllUsers | Remove-AppxPackage
#Get-AppXProvisionedPackage -online | remove-appxprovisionedpackage -online #Get-AppXProvisionedPackage -online | remove-appxprovisionedpackage -online