Remove the Registry hive after making the changes

This commit is contained in:
Jackbennett 2016-05-24 15:50:43 +01:00
parent 2d812f1d02
commit a07062d10d

View File

@ -93,6 +93,10 @@ function Register-Cmder(){
New-ItemProperty -Path "HKCR:\Directory\Background\Shell\Cmder" -Force -Name "NoWorkingDirectory" New-ItemProperty -Path "HKCR:\Directory\Background\Shell\Cmder" -Force -Name "NoWorkingDirectory"
New-Item -Path "HKCR:\Directory\Background\Shell\Cmder\Command" -Force -Value "`"$PathToExe`" `"$Command`" " New-Item -Path "HKCR:\Directory\Background\Shell\Cmder\Command" -Force -Value "`"$PathToExe`" `"$Command`" "
} }
End
{
Remove-PSDrive -Name HKCR
}
} }
function Unregister-Cmder{ function Unregister-Cmder{
@ -105,6 +109,10 @@ function Unregister-Cmder{
Remove-Item -Path "HKCR:\Directory\Shell\Cmder" -Recurse Remove-Item -Path "HKCR:\Directory\Shell\Cmder" -Recurse
Remove-Item -Path "HKCR:\Directory\Background\Shell\Cmder" -Recurse Remove-Item -Path "HKCR:\Directory\Background\Shell\Cmder" -Recurse
} }
End
{
Remove-PSDrive -Name HKCR
}
} }
function Download-File { function Download-File {