Powershell Byte array to INT

Question:

I have a byte array with two values: 07 and DE (in hex).

What I need to do is somehow concatenate the 07DE and get the decimal value from that hex value. In this case, it is 2014.

My code:

How do I combined these to make 07DE and convert that to an int to get 2014?

Answer:

Another option is to use the .NET System.BitConvert class:

Source:

Powershell Byte array to INT by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply