How to set a binary registry value (REG_BINARY) with PowerShell? -


how set binary registry value (reg_binary) powershell?

background:

i need change properties of asp.net state service using powershell script. unfortunately, built-in powershell cmdlet set-service lets modify service description, startup type, display name, , status. need modify subsequent failures property found on recovery tab (when viewing service's properties). found value stored in registry reg_binary value.

an export of value looks this:

[hkey_local_machine\system\controlset001\services\aspnet_state] "failureactions"=hex:50,33,01,00,00,00,00,00,00,00,00,00,03,00,00,00,0e,00,00,\   00,01,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00 

in powershell there set-itemproperty cmdlet can set registry value values. string or dword value, can pass string or int. know hex value in array change, can't figure out how set binary value.

the following line gives example how create one

new-itemproperty -path . -name test -propertytype binary -value ([byte[]](0x30,0x31,0xff)) 

and how change existing one:

set-itemproperty -path . -name test -value ([byte[]](0x33,0x32,0xff)) 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -