Module: SubNetwork
Gets information about a sub-network.
Get-SubNetwork
[[-Address] <byte[]> | <IPAddress> | <IpAddressBits> | <string> | <UInt32>]
[-Bits] <byte>
[<CommonParameters>]
Get-SubNetwork
[[-Address] <byte[]> | <IPAddress> | <IpAddressBits> | <string> | <UInt32>]
[-Mask] <byte[]> | <IPAddress> | <IpAddressBits> | <string> | <UInt32>
[<CommonParameters>]
The Get-SubNetwork
function aggregates the Get-BroadcastAddress
, Get-NetworkAddress
, Get-NetworkBits
, Get-NetworkMask
, and Measure-NetworkAddresses
functions, placing their output in an anonymous object for easy viewing or consumption.
$NetworkInfo = Get-SubNetwork -Address 10.0.0.0 -Bits 8
This example calculates the network mask of the described network.
$NetworkInfo = Get-SubNetwork -Address 192.168.1.42 -Mask 255.255.255.0
This example calculates the network address and network bits of the described network.
Specifies the IP address of the network, or an IP address within the network.
Type |
byte[], IPAddress, IpAddressBits, string, or UInt32 |
---|---|
Position |
0 |
Default Value |
None |
Accept Pipeline Input |
True |
Accept Wildcard Characters |
False |
Specifies the number of network bits.
Type |
|
---|---|
Position |
1 |
Default Value |
None |
Accept Pipeline Input |
False |
Accept Wildcard Characters |
False |
Specifies the network mask.
Type |
byte[], IPAddress, IpAddressBits, string, or UInt32 |
---|---|
Position |
1 |
Default Value |
None |
Accept Pipeline Input |
False |
Accept Wildcard Characters |
False |
byte[], IPAddress, IpAddressBits, *string, or UInt32
You can pipe a string, byte[], UInt32, IPAddress object, or IpAddressBits object to this function.
This cmdlet returns a PSCustomObject with the following structure:
{
[IpAddressBytes] 'Network Address'
[IpAddressBytes] 'Broadcast Address'
[UInt32] 'Addresses Assignable'
[IpAddressBytes] 'Network Mask'
[byte] 'Mask Bits'
}