So I want to create a registry key in:
HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC2 128/128
How do I do this in PowerShell? I tried:
New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC2 128/128"
However PowerShell doesn't like the RC2 128/128 path bit. Its throwing a System ArgumentException.
Assuming you're running .NET 4+, you can try using RegistryKey.CreateSubKey Method:
$key = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey('SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC2 128/128')
$key.Close()
Test-Path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC2 128/128' # => Should be `$true`
Needles to say, PowerShell must be running as Administrator to create a new key in HKLM.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With