I finally figured this out by a combination of some different methods on my part and the Compare-Object cmdlet. Thanks, Dallas.
- Set the appropriate binary value in the registry.
- Retrieve the value via:
$ValueItsSupposedToBe = (Get-ItemProperty -Path HKLM:\Software\ORL\WinVNC3 -Name ACL).ACL
Create a comma,separated string of the values and insert this string into the compare script.
In the compare script, split the string and convert it into a byte array.
[byte[]]$ValueItsSupposedToBe = $ValueItsSupposedToBe.Split(',')
- Read the value currently set on another machine.
$CompareValue = (Get-ItemProperty -Path HKLM:\Software\ORL\WinVNC3 -Name ACL).ACL
- If Compare-Object comes back as null, then they're equal.
Compare-Object $CompareValue $ValueItsSupposedTobe