From ca01f1e13c04c1a805412e6556b0ef893bffb7f4 Mon Sep 17 00:00:00 2001 From: Richard Newton Date: Sun, 23 Dec 2018 15:36:25 -0800 Subject: [PATCH] Added key to disable OneDrive throughout Windows --- Windows10Debloater.ps1 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Windows10Debloater.ps1 b/Windows10Debloater.ps1 index de70d7a..5217aad 100644 --- a/Windows10Debloater.ps1 +++ b/Windows10Debloater.ps1 @@ -599,6 +599,17 @@ Function UninstallOneDrive { Set-ItemProperty $ExplorerReg2 System.IsPinnedToNameSpaceTree -Value 0 Write-Output "Restarting Explorer that was shut down before." Start-Process explorer.exe -NoNewWindow + + Write-Host "Enabling the Group Policy 'Prevent the usage of OneDrive for File Storage'." + $OneDriveKey = 'HKLM:Software\Policies\Microsoft\Windows\OneDrive' + If (!(Test-Path $OneDriveKey)) { + Mkdir $OneDriveKey + } + + $DisableAllOneDrive = 'HKLM:Software\Policies\Microsoft\Windows\OneDrive' + If (Test-Path $DisableAllOneDrive) { + New-ItemProperty $DisableAllOneDrive -Name OneDrive -Value DisableFileSyncNGSC -Verbose + } } #GUI prompt Debloat/Revert options and GUI variables