Should you ever need to create a Powershell key with a forward slash…

posted in: Development | 0

Powershell, by default, creates sub-keys when the key has a slash in it.  This causes all sorts of trouble – especially when you need your keys to be named properly – which is like absolutely, positively every single time.

The current work around is to do this:

$Writable = $True
$Key = (Get-Item HKLM:\).OpenSubKey(“SYSTEM”, $Writable).CreateSubKey(“CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\DES 56/56”)
$Key.SetValue(“Enabled”, “0”, [Microsoft.Win32.RegistryValueKind]::DWORD)

 

This helpful tidbit taken from: http://richardjgreen.net/set-a-registry-value-using-powershell-containing-a-forward-slash/#

Leave a Reply