From a07062d10dc73508cfad709044751add84753ab1 Mon Sep 17 00:00:00 2001 From: Jackbennett Date: Tue, 24 May 2016 15:50:43 +0100 Subject: [PATCH] Remove the Registry hive after making the changes --- scripts/utils.ps1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/utils.ps1 b/scripts/utils.ps1 index f6dde41..d1f932a 100644 --- a/scripts/utils.ps1 +++ b/scripts/utils.ps1 @@ -93,6 +93,10 @@ function Register-Cmder(){ New-ItemProperty -Path "HKCR:\Directory\Background\Shell\Cmder" -Force -Name "NoWorkingDirectory" New-Item -Path "HKCR:\Directory\Background\Shell\Cmder\Command" -Force -Value "`"$PathToExe`" `"$Command`" " } + End + { + Remove-PSDrive -Name HKCR + } } function Unregister-Cmder{ @@ -105,6 +109,10 @@ function Unregister-Cmder{ Remove-Item -Path "HKCR:\Directory\Shell\Cmder" -Recurse Remove-Item -Path "HKCR:\Directory\Background\Shell\Cmder" -Recurse } + End + { + Remove-PSDrive -Name HKCR + } } function Download-File {