PowerShell force [int] to wrap (IP to Long conversion)
问题 Just a quick question as I'm kind of new to math in PowerShell I need to make a converter in PowerShell that converts IP to Long. It works fine for lower values, but on higher ones it is causing an Integer Overflow. [int]$a = Read-Host "First bit of IP address" [int]$b = Read-Host "2nd bit of IP address" [int]$c = Read-Host "3rd bit of IP address" [int]$d = Read-Host "4th bit of IP address" $a *= 16777216 $b *= 65536 $c *= 256 $base10IP = $a + $b + $c + $d Write-Host $base10IP Works fine if I