|
@ -19,7 +19,11 @@ if (Test-Path "$env:systemroot\SysWOW64\OneDriveSetup.exe") { |
|
|
Write-Output "Removing OneDrive leftovers" |
|
|
Write-Output "Removing OneDrive leftovers" |
|
|
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:localappdata\Microsoft\OneDrive" |
|
|
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:localappdata\Microsoft\OneDrive" |
|
|
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:programdata\Microsoft OneDrive" |
|
|
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:programdata\Microsoft OneDrive" |
|
|
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "C:\OneDriveTemp" |
|
|
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:systemdrive\OneDriveTemp" |
|
|
|
|
|
# check if directory is empty before removing: |
|
|
|
|
|
If ((Get-ChildItem "$env:userprofile\OneDrive" -Recurse | Measure-Object).Count -eq 0) { |
|
|
|
|
|
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:userprofile\OneDrive" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
Write-Output "Disable OneDrive via Group Policies" |
|
|
Write-Output "Disable OneDrive via Group Policies" |
|
|
force-mkdir "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" |
|
|
force-mkdir "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" |
|
|