From 43aa460fdb3d88aec5b780985369a3c55d7096db Mon Sep 17 00:00:00 2001 From: narutards Date: Thu, 20 Aug 2015 13:07:41 +0200 Subject: [PATCH 1/2] Update remove-onedrive.ps1 Getting rid of the Registry-Helper where easily possible to slimline the script --- scripts/remove-onedrive.ps1 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/remove-onedrive.ps1 b/scripts/remove-onedrive.ps1 index 6db8b39..e4c6333 100644 --- a/scripts/remove-onedrive.ps1 +++ b/scripts/remove-onedrive.ps1 @@ -22,10 +22,7 @@ rm -Recurse -Force -ErrorAction SilentlyContinue "$env:userprofile\OneDrive" rm -Recurse -Force -ErrorAction SilentlyContinue "C:\OneDriveTemp" echo "Disable OneDrive via Group Policies" -Import-Registry(@" -[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive] -"DisableFileSyncNGSC"=dword:00000001 -"@) +Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive\' -Name DisableFileSyncNGSC -Value 1 echo "Remove Onedrive from explorer sidebar" Import-Registry(@" From 3b77c1cb8ece1df7dd883b434ed74c26fbda5978 Mon Sep 17 00:00:00 2001 From: narutards Date: Fri, 21 Aug 2015 08:16:06 +0200 Subject: [PATCH 2/2] Update remove-onedrive.ps1 --- scripts/remove-onedrive.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/remove-onedrive.ps1 b/scripts/remove-onedrive.ps1 index e4c6333..11103d6 100644 --- a/scripts/remove-onedrive.ps1 +++ b/scripts/remove-onedrive.ps1 @@ -22,6 +22,9 @@ rm -Recurse -Force -ErrorAction SilentlyContinue "$env:userprofile\OneDrive" rm -Recurse -Force -ErrorAction SilentlyContinue "C:\OneDriveTemp" echo "Disable OneDrive via Group Policies" +if (-Not (Get-Item -Path 'HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive\' -ErrorAction SilentlyContinue)) { + New-Item -Path 'HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive\' +} Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive\' -Name DisableFileSyncNGSC -Value 1 echo "Remove Onedrive from explorer sidebar"