Hi,
short post today. Topic: convert a hex string to an integer type.
This can be done by a simple cast. Consider to use try/catch to handle any exceptions.
1 2 3 4 | $sMyHexValue="0xff"$iInt=[Int32]$sMyHexValuewrite-host "HexString:" $sMyHexValue "HexFormatedFromInt" ([string]::Format("0x{0:x}",$iInt)) "Int:" $iIntHexString: 0xff HexFormatedFromInt 0xff Int: 255 |
Michael
helpful!