powershell - Creating Key in regedit with "/"in the name -
hi i'm wondering im creating folder on registry code
function addmachineregistry{ param( [string] $registrypath = $(throw "registrypath required parameter"), [string] $name = $(throw "name required parameter"), [int] $value = $(throw "value required parameter") ) if(!(test-path $registrypath)) { new-item -path $registrypath -itemtype key -force | out-null } new-itemproperty -path $registrypath -name $name -value $value -propertytype dword -force | out-null }
and tried used this
addmachineregistry "hklm:\system\currentcontrolset\control\securityproviders\schannel\ciphers\rc4 40/128\" "enabled" 0
basically im trying create key name of "rc4 40/128" when execute it creates "rc4 40" folder , under creates "128"
im wondering possible create that? since im using "new-item" , giving path. want folder named "rc4 40/128"
normaly must use:
new-itemproperty -path "hklm:\system\currentcontrolset\control\securityproviders\schannel\ciphers\" -name "rc4 40/128" -propertytype dword -value 0
in case be:
addmachineregistry "hklm:\system\currentcontrolset\control\securityproviders\schannel\ciphers\" "rc4 40/128" 0
there no need backslashes "/". alternative: can put path in ' ' instead " ". commands in ' ' change special characters normal chars.
Comments
Post a Comment