Browse Source

suppress errors in onedrive removal script

fix #11
pull/13/head
Alex Hirsch 9 years ago
parent
commit
359746cf07
  1. 10
      scripts/remove-onedrive.ps1

10
scripts/remove-onedrive.ps1

@ -16,10 +16,10 @@ if (Test-Path "$env:systemroot\System32\OneDriveSetup.exe") {
} }
echo "Removing OneDrive leftovers" echo "Removing OneDrive leftovers"
rm -r -Force "$env:localappdata\Microsoft\OneDrive" rm -Recurse -Force -ErrorAction SilentlyContinue "$env:localappdata\Microsoft\OneDrive"
rm -r -Force "$env:programdata\Microsoft OneDrive" rm -Recurse -Force -ErrorAction SilentlyContinue "$env:programdata\Microsoft OneDrive"
rm -r -Force "$env:userprofile\OneDrive" rm -Recurse -Force -ErrorAction SilentlyContinue "$env:userprofile\OneDrive"
rm -r -Force "C:\OneDriveTemp" rm -Recurse -Force -ErrorAction SilentlyContinue "C:\OneDriveTemp"
echo "Disable OneDrive via Group Policies" echo "Disable OneDrive via Group Policies"
Import-Registry(@" Import-Registry(@"
@ -37,7 +37,7 @@ Import-Registry(@"
"@) "@)
echo "Removing startmenu entry" echo "Removing startmenu entry"
rm "$env:userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" rm -Recurse -Force -ErrorAction SilentlyContinue "$env:userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk"
echo "Restarting explorer" echo "Restarting explorer"
start "explorer.exe" start "explorer.exe"

Loading…
Cancel
Save