From 359746cf07e870611ffd154593b2da39f7774a46 Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Mon, 17 Aug 2015 11:22:52 +0200 Subject: [PATCH] suppress errors in onedrive removal script fix #11 --- scripts/remove-onedrive.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/remove-onedrive.ps1 b/scripts/remove-onedrive.ps1 index f83b47e..6db8b39 100644 --- a/scripts/remove-onedrive.ps1 +++ b/scripts/remove-onedrive.ps1 @@ -16,10 +16,10 @@ if (Test-Path "$env:systemroot\System32\OneDriveSetup.exe") { } echo "Removing OneDrive leftovers" -rm -r -Force "$env:localappdata\Microsoft\OneDrive" -rm -r -Force "$env:programdata\Microsoft OneDrive" -rm -r -Force "$env:userprofile\OneDrive" -rm -r -Force "C:\OneDriveTemp" +rm -Recurse -Force -ErrorAction SilentlyContinue "$env:localappdata\Microsoft\OneDrive" +rm -Recurse -Force -ErrorAction SilentlyContinue "$env:programdata\Microsoft OneDrive" +rm -Recurse -Force -ErrorAction SilentlyContinue "$env:userprofile\OneDrive" +rm -Recurse -Force -ErrorAction SilentlyContinue "C:\OneDriveTemp" echo "Disable OneDrive via Group Policies" Import-Registry(@" @@ -37,7 +37,7 @@ Import-Registry(@" "@) 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" start "explorer.exe"