Added New-PSDrive HKCR in uninstall OneDrive Function

I added code to create a new PSDrive for HKCR so that the function can access the portion of the registry associated with HKCR and create/modify the specific registry keys.

I believe this resolves the function from hanging.
pull/47/head
Richard Newton 6 years ago committed by GitHub
parent 57ef7e83b6
commit d2c812df11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -512,11 +512,14 @@ Function EnableWAPPush {
}
Function UninstallOneDrive {
Write-Output "Uninstalling OneDrive"
Write-Output "Uninstalling OneDrive"
New-PSDrive HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
$onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe"
$ExplorerReg1 = "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}"
$ExplorerReg2 = "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}"
Stop-Process OneDrive
Stop-Process -Name "OneDrive*"
Start-Sleep 2
If (!(Test-Path $onedrive)) {
$onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe"

Loading…
Cancel
Save