Bläddra i källkod

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.
Richard Newton 6 år sedan
förälder
incheckning
d2c812df11
1 ändrade filer med 5 tillägg och 2 borttagningar
  1. 5 2
      Windows10Debloater.ps1

+ 5 - 2
Windows10Debloater.ps1

@@ -512,11 +512,14 @@ Function EnableWAPPush {
 }
 }
 
 
 Function UninstallOneDrive {
 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"
     $onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe"
     $ExplorerReg1 = "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}"
     $ExplorerReg1 = "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}"
     $ExplorerReg2 = "HKCR:\Wow6432Node\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
 	Start-Sleep 2
 	If (!(Test-Path $onedrive)) {
 	If (!(Test-Path $onedrive)) {
 		$onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe"
 		$onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe"