@ -1,33 +1,33 @@
#This function finds any AppX/AppXProvisioned package and uninstalls it, except for Freshpaint, Windows Calculator, Windows Store, and Windows Photos.
#Also, to note - This does NOT remove essential system services/software/etc such as .NET framework installations, Cortana, Edge, etc.
I f ( Test-Path " C:\Windows10Debloater " ) {
i f ( Test-Path " C:\Windows10Debloater " ) {
Write-Output " C:\Windows10Debloater exists. Skipping. "
}
E lse {
e lse {
Write-Output " The folder 'C:\Windows10Debloater' doesn't exist. This folder will be used for storing logs created after the script runs. Creating now. "
Sleep 1
New-Item -Path " C:\Windows10Debloater " -ItemType Directory
}
Start-Transcript -OutputDirectory " C:\Windows10Debloater "
F unction Start-Debloat {
f unction Start-Debloat {
[ CmdletBinding ( ) ]
P aram( )
p aram( )
#Removes AppxPackages
#Credit to /u/GavinEke for a modified version of my whitelist code
[ regex ] $WhitelistedApps = 'Microsoft.Paint3D|Microsoft.WindowsCalculator|Microsoft.WindowsStore|Microsoft.Windows.Photos'
Get-AppxPackage -AllUsers | Where-Object { $_ . Name -NotMatch $WhitelistedApps } | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxProvisionedPackage -Online | Where-Object { $_ . PackageName -NotMatch $WhitelistedApps } | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers | Where-Object { $_ . Name -notmatch $WhitelistedApps } | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxProvisionedPackage -Online | Where-Object { $_ . PackageName -notmatch $WhitelistedApps } | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
}
F unction Remove-Keys {
f unction Remove-Keys {
[ CmdletBinding ( ) ]
P aram( )
p aram( )
#These are the registry keys that it will delete.
@ -65,29 +65,29 @@ Function Remove-Keys {
)
#This writes the output of each key it is removing and also removes the keys listed above.
ForE ach ( $Key in $Keys ) {
fore ach ( $Key in $Keys ) {
Write-Output " Removing $Key from registry "
Remove-Item $Key -Recurse -ErrorAction SilentlyContinue
}
}
F unction Protect-Privacy {
f unction Protect-Privacy {
[ CmdletBinding ( ) ]
P aram( )
p aram( )
#Disables Windows Feedback Experience
Write-Output " Disabling Windows Feedback Experience program "
$Advertising = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo'
I f ( Test-Path $Advertising ) {
i f ( Test-Path $Advertising ) {
Set-ItemProperty $Advertising -Name Enabled -Value 0 -Verbose
}
#Stops Cortana from being used as part of your Windows Search Function
Write-Output " Stopping Cortana from being used as part of your Windows Search Function "
$Search = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search'
I f ( Test-Path $Search ) {
i f ( Test-Path $Search ) {
Set-ItemProperty $Search -Name AllowCortana -Value 0 -Verbose
}
@ -96,7 +96,7 @@ Function Protect-Privacy {
$Period1 = 'HKCU:\Software\Microsoft\Siuf'
$Period2 = 'HKCU:\Software\Microsoft\Siuf\Rules'
$Period3 = 'HKCU:\Software\Microsoft\Siuf\Rules\PeriodInNanoSeconds'
I f ( ! ( Test-Path $Period3 ) ) {
i f ( ! ( Test-Path $Period3 ) ) {
mkdir $Period1 -ErrorAction SilentlyContinue
mkdir $Period2 -ErrorAction SilentlyContinue
mkdir $Period3 -ErrorAction SilentlyContinue
@ -106,21 +106,21 @@ Function Protect-Privacy {
Write-Output " Adding Registry key to prevent bloatware apps from returning "
#Prevents bloatware applications from returning
$registryPath = " HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent "
I f ( ! ( Test-Path $registryPath ) ) {
M kdir $registryPath -ErrorAction SilentlyContinue
i f ( ! ( Test-Path $registryPath ) ) {
m kdir $registryPath -ErrorAction SilentlyContinue
New-ItemProperty $registryPath -Name DisableWindowsConsumerFeatures -Value 1 -Verbose -ErrorAction SilentlyContinue
}
Write-Output " Setting Mixed Reality Portal value to 0 so that you can uninstall it in Settings "
$Holo = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Holographic'
I f ( Test-Path $Holo ) {
i f ( Test-Path $Holo ) {
Set-ItemProperty $Holo -Name FirstRunSucceeded -Value 0 -Verbose
}
#Disables live tiles
Write-Output " Disabling live tiles "
$Live = 'HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications'
I f ( ! ( Test-Path $Live ) ) {
i f ( ! ( Test-Path $Live ) ) {
mkdir $Live -ErrorAction SilentlyContinue
New-ItemProperty $Live -Name NoTileApplicationNotification -Value 1 -Verbose
}
@ -128,21 +128,21 @@ Function Protect-Privacy {
#Turns off Data Collection via the AllowTelemtry key by changing it to 0
Write-Output " Turning off Data Collection "
$DataCollection = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection'
I f ( Test-Path $DataCollection ) {
i f ( Test-Path $DataCollection ) {
Set-ItemProperty $DataCollection -Name AllowTelemetry -Value 0 -Verbose
}
#Disables People icon on Taskbar
Write-Output " Disabling People icon on Taskbar "
$People = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People'
I f ( ! ( Test-Path $People ) ) {
i f ( ! ( Test-Path $People ) ) {
mkdir $People -ErrorAction SilentlyContinue
New-ItemProperty $People -Name PeopleBand -Value 0 -Verbose
}
#Disables suggestions on start menu
Write-Output " Disabling suggestions on the Start Menu "
I f ( 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' ) {
i f ( 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' ) {
$Suggestions = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager'
Set-ItemProperty $Suggestions -Name SystemPaneSuggestionsEnabled -Value 0 -Verbose
}
@ -157,74 +157,74 @@ Function Protect-Privacy {
Get-ScheduledTask -TaskName DmClientOnScenarioDownload | Disable-ScheduledTask
}
F unction Stop-EdgePDF {
f unction Stop-EdgePDF {
Write-Output " Stopping Edge from taking over as the default .PDF viewer "
#Stops edge from taking over as the default .PDF viewer
I f ( ! ( Get-ItemProperty 'HKCR:\.pdf' -Name NoOpenWith ) ) {
i f ( ! ( Get-ItemProperty 'HKCR:\.pdf' -Name NoOpenWith ) ) {
$NoOpen = 'HKCR:\.pdf'
New-ItemProperty $NoOpen -Name NoOpenWith -Verbose -ErrorAction SilentlyContinue
}
I f ( ! ( Get-ItemProperty 'HKCR:\.pdf' -Name NoStaticDefaultVerb ) ) {
i f ( ! ( Get-ItemProperty 'HKCR:\.pdf' -Name NoStaticDefaultVerb ) ) {
$NoStatic = 'HKCR:\.pdf'
New-ItemProperty $NoStatic -Name NoStaticDefaultVerb -Verbose -ErrorAction SilentlyContinue
}
I f ( ! ( Get-ItemProperty 'HKCR:\.pdf\OpenWithProgids' -Name NoOpenWith ) ) {
i f ( ! ( Get-ItemProperty 'HKCR:\.pdf\OpenWithProgids' -Name NoOpenWith ) ) {
$NoOpen = 'HKCR:\.pdf\OpenWithProgids'
New-ItemProperty $NoOpen -Name NoOpenWith -Verbose -ErrorAction SilentlyContinue
}
I f ( ! ( Get-ItemProperty 'HKCR:\.pdf\OpenWithProgids' -Name NoStaticDefaultVerb ) ) {
i f ( ! ( Get-ItemProperty 'HKCR:\.pdf\OpenWithProgids' -Name NoStaticDefaultVerb ) ) {
$NoStatic = 'HKCR:\.pdf\OpenWithProgids'
New-ItemProperty $NoStatic -Name NoStaticDefaultVerb -Verbose -ErrorAction SilentlyContinue
}
I f ( ! ( Get-ItemProperty 'HKCR:\.pdf\OpenWithList' -Name NoOpenWith ) ) {
i f ( ! ( Get-ItemProperty 'HKCR:\.pdf\OpenWithList' -Name NoOpenWith ) ) {
$NoOpen = 'HKCR:\.pdf\OpenWithList'
New-ItemProperty $NoOpen -Name NoOpenWith -Verbose -ErrorAction SilentlyContinue
}
I f ( ! ( Get-ItemProperty 'HKCR:\.pdf\OpenWithList' -Name NoStaticDefaultVerb ) ) {
i f ( ! ( Get-ItemProperty 'HKCR:\.pdf\OpenWithList' -Name NoStaticDefaultVerb ) ) {
$NoStatic = 'HKCR:\.pdf\OpenWithList'
New-ItemProperty $NoStatic -Name NoStaticDefaultVerb -Verbose -ErrorAction SilentlyContinue
}
#Appends an underscore '_' to the Registry key for Edge
I f ( 'HKCR:\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723' ) {
i f ( 'HKCR:\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723' ) {
$Edge = 'HKCR:\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723'
Set-Item $Edge AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723_ -Verbose
}
}
F unction Revert-Changes {
f unction Revert-Changes {
[ CmdletBinding ( ) ]
P aram( )
p aram( )
#This function will revert the changes you made when running the Start-Debloat function.
#This line reinstalls all of the bloatware that was removed
Get-AppxPackage -AllUsers | ForEach { Add-AppxPackage -Verbose -DisableDevelopmentMode -Register " $( $_ . InstallLocation ) \AppXManifest.xml " } -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers | ForEach-Object { Add-AppxPackage -Verbose -DisableDevelopmentMode -Register " $( $_ . InstallLocation ) \AppXManifest.xml " } -ErrorAction SilentlyContinue
Write-Output " Re-enabling key to show advertisement information "
#Tells Windows to enable your advertising information.
I f ( 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo' ) {
i f ( 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo' ) {
$Advertising = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo'
Set-ItemProperty $Advertising -Name Enabled -Value 1 -Verbose
}
#Enables Cortana to be used as part of your Windows Search Function
Write-Output " Re-enabling Cortana to be used in your Windows Search "
I f ( 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search' ) {
i f ( 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search' ) {
$Search = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search'
Set-ItemProperty $Search -Name AllowCortana -Value 1 -Verbose
}
#Re-enables the Windows Feedback Experience for sending anonymous data
Write-Output " Re-enabling Windows Feedback Experience "
I f ( ! ( 'HKCU:\Software\Microsoft\Siuf\Rules\PeriodInNanoSeconds' ) ) {
i f ( ! ( 'HKCU:\Software\Microsoft\Siuf\Rules\PeriodInNanoSeconds' ) ) {
mkdir 'HKCU:\Software\Microsoft\Siuf\Rules\PeriodInNanoSeconds'
$Period = 'HKCU:\Software\Microsoft\Siuf\Rules\PeriodInNanoSeconds'
New-Item $Period -ErrorAction SilentlyContinue
@ -233,22 +233,22 @@ Function Revert-Changes {
Write-Output " Adding Registry key to prevent bloatware apps from returning "
#Enables bloatware applications
I f ( 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent' ) {
i f ( 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent' ) {
$registryPath = " HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent "
M kdir $registryPath -ErrorAction SilentlyContinue
m kdir $registryPath -ErrorAction SilentlyContinue
New-ItemProperty $registryPath -Name DisableWindowsConsumerFeatures -Value 0 -Verbose -ErrorAction SilentlyContinue
}
#Changes Mixed Reality Portal Key 'FirstRunSucceeded' to 1
Write-Output " Setting Mixed Reality Portal value to 1 "
I f ( 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Holographic' ) {
i f ( 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Holographic' ) {
$Holo = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Holographic'
Set-ItemProperty $Holo -Name FirstRunSucceeded -Value 1 -Verbose
}
#Re-enables live tiles
Write-Output " Enabling live tiles "
I f ( 'HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications' ) {
i f ( 'HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications' ) {
mkdir 'HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications' -ErrorAction SilentlyContinue
$Live = 'HKCU:\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications'
New-ItemProperty $Live -Name NoTileApplicationNotification -Value 0 -Verbose -ErrorAction SilentlyContinue
@ -256,29 +256,29 @@ Function Revert-Changes {
Write-Output " Changing the 'Cloud Content' registry key value to 1 to allow bloatware apps to reinstall "
#Prevents bloatware applications from returning
I f ( " HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent\ " ) {
i f ( " HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent\ " ) {
$registryPath = " HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent "
M kdir $registryPath -ErrorAction SilentlyContinue
m kdir $registryPath -ErrorAction SilentlyContinue
New-ItemProperty $registryPath -Name DisableWindowsConsumerFeatures -Value 1 -Verbose -ErrorAction SilentlyContinue
}
#Re-enables data collection
Write-Output " Re-enabling data collection "
I f ( 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection' ) {
i f ( 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection' ) {
$DataCollection = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection'
Set-ItemProperty $DataCollection -Name AllowTelemetry -Value 1 -Verbose
}
#Re-enables People Icon on Taskbar
Write-Output " Enabling People icon on Taskbar "
I f ( 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People' ) {
i f ( 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People' ) {
$People = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People'
New-ItemProperty $People -Name PeopleBand -Value 1 -Verbose -ErrorAction SilentlyContinue
}
#Re-enables suggestions on start menu
Write-Output " Enabling suggestions on the Start Menu "
I f ( 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' ) {
i f ( 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' ) {
$Suggestions = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager'
Set-ItemProperty $Suggestions -Name SystemPaneSuggestionsEnabled -Value 1 -Verbose
}
@ -293,70 +293,72 @@ Function Revert-Changes {
Get-ScheduledTask -TaskName DmClientOnScenarioDownload | Enable-ScheduledTask
}
F unction Enable-EdgePDF {
f unction Enable-EdgePDF {
Write-Output " Setting Edge back to default "
#Sets edge back to default
I f ( Get-ItemProperty 'HKCR:\.pdf' -Name NoOpenWith ) {
i f ( Get-ItemProperty 'HKCR:\.pdf' -Name NoOpenWith ) {
$NoOpen = 'HKCR:\.pdf'
Remove-ItemProperty $NoOpen -Name NoOpenWith -Verbose
}
I f ( Get-ItemProperty 'HKCR:\.pdf' -Name NoStaticDefaultVerb ) {
i f ( Get-ItemProperty 'HKCR:\.pdf' -Name NoStaticDefaultVerb ) {
$NoStatic = 'HKCR:\.pdf'
Remove-ItemProperty $NoStatic -Name NoStaticDefaultVerb -Verbose
}
I f ( Get-ItemProperty 'HKCR:\.pdf\OpenWithProgids' -Name NoOpenWith ) {
i f ( Get-ItemProperty 'HKCR:\.pdf\OpenWithProgids' -Name NoOpenWith ) {
$NoOpen = 'HKCR:\.pdf\OpenWithProgids'
Remove-ItemProperty $NoOpen -Name NoOpenWith -Verbose
}
I f ( Get-ItemProperty 'HKCR:\.pdf\OpenWithProgids' -Name NoStaticDefaultVerb ) {
i f ( Get-ItemProperty 'HKCR:\.pdf\OpenWithProgids' -Name NoStaticDefaultVerb ) {
$NoStatic = 'HKCR:\.pdf\OpenWithProgids'
Remove-ItemProperty $NoStatic -Name NoStaticDefaultVerb -Verbose
}
I f ( Get-ItemProperty 'HKCR:\.pdf\OpenWithList' -Name NoOpenWith ) {
i f ( Get-ItemProperty 'HKCR:\.pdf\OpenWithList' -Name NoOpenWith ) {
$NoOpen = 'HKCR:\.pdf\OpenWithList'
Remove-ItemProperty $NoOpen -Name NoOpenWith -Verbose
}
I f ( Get-ItemProperty 'HKCR:\.pdf\OpenWithList' -Name NoStaticDefaultVerb ) {
i f ( Get-ItemProperty 'HKCR:\.pdf\OpenWithList' -Name NoStaticDefaultVerb ) {
$NoStatic = 'HKCR:\.pdf\OpenWithList'
Remove-ItemProperty $NoStatic -Name NoStaticDefaultVerb -Verbose
}
#Removes an underscore '_' from the Registry key for Edge
I f ( 'HKCR:\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723' ) {
i f ( 'HKCR:\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723' ) {
$Edge = 'HKCR:\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723'
Set-Item $Edge AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723 -Verbose
}
}
F unction FixWhitelistedApps {
f unction FixWhitelistedApps {
[ CmdletBinding ( ) ]
P aram( )
p aram( )
If ( ! ( Get-AppxPackage -AllUsers | Select Microsoft . Paint3D , Microsoft . WindowsCalculator , Microsoft . WindowsStore , Microsoft . Windows . Photos ) ) {
if ( ! ( Get-AppxPackage -AllUsers | Select-Object Microsoft . Paint3D , Microsoft . WindowsCalculator , Microsoft . WindowsStore , Microsoft . Windows . Photos ) ) {
#Credit to abulgatz for these 4 lines of code
Get-AppxPackage -allusers Microsoft . Paint3D | Foreach { Add-AppxPackage -DisableDevelopmentMode -Register " $( $_ . InstallLocation ) \AppXManifest.xml " }
Get-AppxPackage -allusers Microsoft . WindowsCalculator | Foreach { Add-AppxPackage -DisableDevelopmentMode -Register " $( $_ . InstallLocation ) \AppXManifest.xml " }
Get-AppxPackage -allusers Microsoft . WindowsStore | Foreach { Add-AppxPackage -DisableDevelopmentMode -Register " $( $_ . InstallLocation ) \AppXManifest.xml " }
Get-AppxPackage -allusers Microsoft . Windows . Photos | Foreach { Add-AppxPackage -DisableDevelopmentMode -Register " $( $_ . InstallLocation ) \AppXManifest.xml " } } }
Get-AppxPackage -AllUsers Microsoft . Paint3D | ForEach-Object { Add-AppxPackage -DisableDevelopmentMode -Register " $( $_ . InstallLocation ) \AppXManifest.xml " }
Get-AppxPackage -AllUsers Microsoft . WindowsCalculator | ForEach-Object { Add-AppxPackage -DisableDevelopmentMode -Register " $( $_ . InstallLocation ) \AppXManifest.xml " }
Get-AppxPackage -AllUsers Microsoft . WindowsStore | ForEach-Object { Add-AppxPackage -DisableDevelopmentMode -Register " $( $_ . InstallLocation ) \AppXManifest.xml " }
Get-AppxPackage -AllUsers Microsoft . Windows . Photos | ForEach-Object { Add-AppxPackage -DisableDevelopmentMode -Register " $( $_ . InstallLocation ) \AppXManifest.xml " }
}
}
#This switch will ask you if you'd like to run the script as interactive or silently. Depending on your selection, yes will be interactive, no will be silent.
Write-Output " How would you like to run this script? "
$ReadHost = Read-Host " ( Interactive / Noninteractive ) "
S witch ( $ReadHost ) {
s witch ( $ReadHost ) {
Interactive {
#Switch statement containing Debloat/Revert options
Write-Output " The following options will allow you to either Debloat Windows 10, or to revert changes made after Debloating Windows 10.
Choose 'Debloat' to Debloat Windows 10 or choose 'Revert' to revert changes . "
$Readhost = Read-Host " ( Debloat / Revert ) "
S witch ( $ReadHost ) {
s witch ( $ReadHost ) {
#This will debloat Windows 10
Debloat {
#Creates a "drive" to access the HKCR (HKEY_CLASSES_ROOT)
@ -382,7 +384,7 @@ Switch ($ReadHost) {
Write-Output " Do you want to stop edge from taking over as the default PDF viewer? "
$ReadHost = Read-Host " (Yes / No ) "
S witch ( $ReadHost ) {
s witch ( $ReadHost ) {
Yes {
Stop-EdgePDF
Write-Output " Edge will no longer take over as the default PDF viewer. " ; $PublishSettings = $Yes
@ -394,7 +396,7 @@ Switch ($ReadHost) {
#Switch statement asking if you'd like to reboot your machine
Write-Output " For some of the changes to properly take effect it is recommended to reboot your machine. Would you like to restart? "
$ReadHost = Read-Host " ( Yes / No ) "
S witch ( $Readhost ) {
s witch ( $Readhost ) {
Yes {
Write-Output " Unloading the HKCR drive... "
Remove-PSDrive HKCR
@ -411,7 +413,7 @@ Switch ($ReadHost) {
Stop-Transcript
Write-Output " Script has finished. Exiting. "
Sleep 2
E xit; $PublishSettings = $No
e xit; $PublishSettings = $No
}
}
}
@ -422,7 +424,7 @@ Switch ($ReadHost) {
Revert-Changes ; $PublishSettings = $Revert
Write-Output " Do you want to revert changes that disabled Edge as the default PDF viewer? "
$ReadHost = Read-Host " (Yes / No ) "
S witch ( $ReadHost ) {
s witch ( $ReadHost ) {
Yes {
Enable-EdgePDF
Write-Output " Edge will no longer be disabled from being used as the default Edge PDF viewer. " ; $PublishSettings = $Yes
@ -432,7 +434,7 @@ Switch ($ReadHost) {
#Switch statement asking if you'd like to reboot your machine
Write-Output " For some of the changes to properly take effect it is recommended to reboot your machine. Would you like to restart? "
$Readhost = Read-Host " ( Yes / No ) "
S witch ( $Readhost ) {
s witch ( $Readhost ) {
Yes {
Write-Output " Unloading the HKCR drive... "
Remove-PSDrive HKCR
@ -449,7 +451,7 @@ Switch ($ReadHost) {
Write-Output " Script has finished. Exiting. "
Stop-Transcript
Sleep 2
E xit; $PublishSettings = $No
e xit; $PublishSettings = $No
}
}
}
@ -458,7 +460,7 @@ Switch ($ReadHost) {
Noninteractive {
Write-Output " You will not be prompted for any other questions after this. With either option your machine will not automatically reboot and you will need to manually reboot. Would you like to Debloat or Revert changes? "
$Readhost = Read-Host " ( Debloat / Revert ) "
S witch ( $ReadHost ) {
s witch ( $ReadHost ) {
Debloat {
Write-Output " Uninstalling bloatware. Please wait. "
Start-Debloat
@ -476,7 +478,7 @@ Switch ($ReadHost) {
Write-Output " Script has finished. Exiting now. "
Sleep 2
Stop-Transcript
E xit; $PublishSettings = $Debloat
e xit; $PublishSettings = $Debloat
}
Revert {
Write-Output " Reverting changes... "
@ -495,7 +497,7 @@ Switch ($ReadHost) {
Write-Output " Script has finished. Exiting now. "
Stop-Transcript
Sleep 2
E xit; $PublishSettings = $Revert
e xit; $PublishSettings = $Revert
}
}
}