Search code examples
powershell32-bitunsigned-integer

How to declare an unsigned 32-bit integer?


Is there a way to declare a 32-bit unsigned integer in PowerShell?

I'm trying to add an unsigned (begin with 0xf) i.e. 0xff000000 + 0xAA, but it turned out to be a negative number whereas I want it to be 0xff0000AA.


Solution

  • 0xff00000AA is too large for a 32 bit unsigned integer, use uint64

    PS> [uint64]0xff00000AA
    68451041450