@@ -25,14 +25,14 @@ function Remove-OneDrive() {
25
25
}
26
26
27
27
Write-Host " Disable OneDrive via Group Policies."
28
- Set-ItemPropertyVerified - Path " HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" " DisableFileSyncNGSC" 1
28
+ Set-ItemPropertyVerified - Path " HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" - Name " DisableFileSyncNGSC" - Type DWord - Value 1
29
29
30
30
Write-Host " Remove Onedrive from explorer sidebar."
31
- New-PSDrive - PSProvider " Registry" - Root " HKEY_CLASSES_ROOT" - Name " HKCR"
31
+ New-PSDrive - PSProvider " Registry" - Root " HKEY_CLASSES_ROOT" - Scope Global - Name " HKCR"
32
32
mkdir - Force " HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}"
33
- Set-ItemPropertyVerified - Path " HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" " System.IsPinnedToNameSpaceTree" 0
33
+ Set-ItemPropertyVerified - Path " HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" - Name " System.IsPinnedToNameSpaceTree" - Type DWord - Value 0
34
34
mkdir - Force " HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}"
35
- Set-ItemPropertyVerified - Path " HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" " System.IsPinnedToNameSpaceTree" 0
35
+ Set-ItemPropertyVerified - Path " HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" - Name " System.IsPinnedToNameSpaceTree" - Type DWord - Value 0
36
36
Remove-PSDrive " HKCR"
37
37
38
38
# Thank you Matthew Israelsson
@@ -42,7 +42,7 @@ function Remove-OneDrive() {
42
42
reg unload " hku\Default"
43
43
44
44
Write-Host " Removing startmenu entry..."
45
- Remove-ItemVerified - Force - ErrorAction SilentlyContinue " $env: userprofile \AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk"
45
+ Remove-ItemVerified - Path " $env: userprofile \AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" - Force - ErrorAction SilentlyContinue
46
46
47
47
Write-Host " Removing scheduled task..."
48
48
Get-ScheduledTask - TaskPath ' \' - TaskName ' OneDrive*' - ea SilentlyContinue | Unregister-ScheduledTask - Confirm:$false
0 commit comments