Initializes a new instance of the IpAddressBits class.
Initializes a new instance of the IpAddressBits class with the address specified as a Byte array. |
|
Initializes a new instance of the IpAddressBits class with the specified number of bits set. |
|
Initializes a new instance of the IpAddressBits class with the address specified as a IPAddress. |
|
Initializes a new instance of the IpAddressBits class with the address specified as a IpAddressBits. |
|
Initializes a new instance of the IpAddressBits class with the address specified as a UInt32. |
Initializes a new instance of the IpAddressBits class with the address specified as a Byte array.
[IpAddressBits]::new([byte] $bits)
bits
byte-
The number of bits to set on in the address (starting from the first octet’s highest bit).
- ArgumentOutOfRangeException
-
bits
is larger than 32.
This constructor is useful for creating subnet masks.
Initializes a new instance of the IpAddressBits class with the specified number of bits set.
[IpAddressBits]::new([byte[]] $bytes)
bytes
byte[]-
A byte array containing the octets of an IP Address.
- ArgumentException
-
bytes
contains an invalid number of octets. The length ofbytes
must be exactly four. - ArgumentNullException
-
bytes
isnull
.
Initializes a new instance of the IpAddressBits class with the address specified as a IPAddress.
[IpAddressBits]::new([IPAddress] $ipAddress)
- ArgumentException
-
ipAddress
is not an IPv4 address. Non-IPv4 addresses are not supported. - ArgumentNullException
-
ipAddress
isnull
.
Initializes a new instance of the IpAddressBits class with the address specified as a IpAddressBits.
[IpAddressBits]::new([IpAddressBits] $ipAddress)
ipAddress
IpAddressBits-
An IpAddressBits to copy.
- ArgumentNullException
-
ipAddress
isnull
.
This constructor probably isn’t what you are looking for; it’s provided for PowerShell’s type coercion.
Initializes a new instance of the IpAddressBits class with the address specified as a UInt32.
[IpAddressBits]::new([UInt32] $bits)
bits
UInt32-
An unsigned integer from which to construct an IpAddressBits.