Reg2CI icon indicating copy to clipboard operation
Reg2CI copied to clipboard

Registry entries with a forward slash aren't created correctly.

Open bmitchell76 opened this issue 3 years ago • 1 comments

For example this key

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\AES 128/128] "Enabled"=dword:ffffffff

Creates this code

Reg2CI (c) 2021 by Roger Zander

if((Test-Path -LiteralPath "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\AES 128/128") -ne $true) { New-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\AES 128/128" -force -ea SilentlyContinue }; New-ItemProperty -LiteralPath 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\AES 128/128' -Name 'Enabled' -Value -1 -PropertyType DWord -Force -ea SilentlyContinue;

and when run creates the following

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\AES 128\128] "Enabled"=dword:ffffffff

The difference being "AES 128/128" vs "AES 128\128"

bmitchell76 avatar Apr 28 '21 20:04 bmitchell76

for reference see the following

https://richardjgreen.net/set-a-registry-value-using-powershell-containing-a-forward-slash/

bmitchell76 avatar Apr 28 '21 20:04 bmitchell76