Removed line 15

I removed the code from line 15 as this will wipe more than the target appxpackages/appxprovisionedpackages since even some games/apps/etc from the Microsoft Store and others that are wanted will be removed.
pull/53/head
Richard Newton 6 years ago committed by GitHub
parent 0c90e11309
commit b51963269e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,14 +7,27 @@ param (
[switch]$Debloat, [switch]$SysPrep
)
#This will run get-appxpackage | remove-appxpackage which is required for sysprep to provision the apps.
Function Begin-SysPrep {
param([switch]$SysPrep)
get-appxpackage | remove-appxpackage -ErrorAction SilentlyContinue
}
Write-Verbose -Message ('Starting Sysprep Fixes')
# Disable Windows Store Automatic Updates
Write-Verbose -Message "Adding Registry key to Disable Windows Store Automatic Updates"
$registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\WindowsStore"
If (!(Test-Path $registryPath)) {
Mkdir $registryPath -ErrorAction SilentlyContinue
New-ItemProperty $registryPath -Name AutoDownload -Value 2
}
Else {
Set-ItemProperty $registryPath -Name AutoDownload -Value 2
}
#Stop WindowsStore Installer Service and set to Disabled
Write-Verbose -Message ('Stopping InstallService')
Stop-Service InstallService
Write-Verbose -Message ('Setting InstallService Startup to Disabled')
& sc config InstallService start=disabled
}
#Creates a PSDrive to be able to access the 'HKCR' tree
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT

Loading…
Cancel
Save