From d2c812df112dda497b194be60a96230cfbfca249 Mon Sep 17 00:00:00 2001 From: Richard Newton Date: Sat, 18 Aug 2018 23:22:07 -0700 Subject: [PATCH] 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. --- Windows10Debloater.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Windows10Debloater.ps1 b/Windows10Debloater.ps1 index 72da010..655731e 100644 --- a/Windows10Debloater.ps1 +++ b/Windows10Debloater.ps1 @@ -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"