From 8e137a2e2e98132280de18da9ecfc392debdec6b Mon Sep 17 00:00:00 2001 From: Richard Newton Date: Sat, 1 Dec 2018 11:08:26 -0800 Subject: [PATCH] Update Windows10Debloater.ps1 --- Windows10Debloater.ps1 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Windows10Debloater.ps1 b/Windows10Debloater.ps1 index db1f1e6..8e3cc26 100644 --- a/Windows10Debloater.ps1 +++ b/Windows10Debloater.ps1 @@ -293,10 +293,14 @@ Function Protect-Privacy { Stop-Service "DiagTrack" Set-Service "DiagTrack" -StartupType Disabled - Write-Output "Removing CloudStore from registry if it exists" - Stop-Process Explorer.exe -Force - Remove-Item "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CloudStore" - Start-Process Explorer.exe -Wait + + Write-Output "Removing CloudStore from registry if it exists" + $CloudStore = 'HKCUSoftware\Microsoft\Windows\CurrentVersion\CloudStore' + If (Test-Path $CloudStore) { + Stop-Process Explorer.exe -Force + Remove-Item $CloudStore + Start-Process Explorer.exe -Wait + } } Function DisableCortana {