I’ve got |-delimited data in the form:
SiteCode|Abbrev|Login|Password
7777|its|0x33,0xfc,0x00|0x33,0xfc,0x00
etc.
So I try:
<code> $siteData = Import-Csv Sites.csv -Delimiter '|' $strSite = '7777' $objMatch = $siteData | Where-Object {$_.SiteCode -eq $strSite} $strLoginTemp = $objMatch.Login $strLogin = "([byte[]](${strLoginTemp}))" Set-RegistryKey -Key 'HKCU\Software\Dynix\HorizonS75\Connect\HORIZON' -Name 'Login' -Value $strLogin -Type Binary </code>
I get ‘Input string was not in a correct format’
It can change the value directly with Set-ItemProperty, but Set-RegistryKey doesn’t like it.
What am I doing wrong?