System administrators work with IP version 4 (IPv4) addresses on a regular basis. If you’ve ever had to work with IPv4 addresses in scripts, you’re already aware of the complications: IPv4 addresses are 32-bit numbers, not strings. In order to calculate a network ID, for example, you need to use the bitwise AND operator with the IPv4 address and a subnet mask. These calculations can be challenging to get right in shell script (batch) and VBScript or JScript due to string parsing and byte order, but fortunately things are much simpler in PowerShell, because we can use the .NET IPAddress class.