Skip to content

Latest commit

 

History

History
137 lines (114 loc) · 4.77 KB

Ctor.adoc

File metadata and controls

137 lines (114 loc) · 4.77 KB

IpAddressBits Constructors

Definition

Initializes a new instance of the IpAddressBits class.

Overloads

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.

IpAddressBits(byte)

Initializes a new instance of the IpAddressBits class with the address specified as a Byte array.

[IpAddressBits]::new([byte] $bits)

Parameters

bits byte

The number of bits to set on in the address (starting from the first octet’s highest bit).

Exceptions

ArgumentOutOfRangeException

bits is larger than 32.

Remarks

This constructor is useful for creating subnet masks.

IpAddressBits(byte[])

Initializes a new instance of the IpAddressBits class with the specified number of bits set.

[IpAddressBits]::new([byte[]] $bytes)

Parameters

bytes byte[]

A byte array containing the octets of an IP Address.

Exceptions

ArgumentException

bytes contains an invalid number of octets. The length of bytes must be exactly four.

ArgumentNullException

bytes is null.

IpAddressBits(IPAddress)

Initializes a new instance of the IpAddressBits class with the address specified as a IPAddress.

[IpAddressBits]::new([IPAddress] $ipAddress)

Parameters

ipAddress IPAddress

An IPAddress to set the address from.

Exceptions

ArgumentException

ipAddress is not an IPv4 address. Non-IPv4 addresses are not supported.

ArgumentNullException

ipAddress is null.

IpAddressBits(IpAddressBits)

Initializes a new instance of the IpAddressBits class with the address specified as a IpAddressBits.

[IpAddressBits]::new([IpAddressBits] $ipAddress)

Parameters

ipAddress IpAddressBits

An IpAddressBits to copy.

Exceptions

ArgumentNullException

ipAddress is null.

Remarks

This constructor probably isn’t what you are looking for; it’s provided for PowerShell’s type coercion.

IpAddressBits(UInt32)

Initializes a new instance of the IpAddressBits class with the address specified as a UInt32.

[IpAddressBits]::new([UInt32] $bits)

Parameters

bits UInt32

An unsigned integer from which to construct an IpAddressBits.