Skip to content

Latest commit

 

History

History
118 lines (101 loc) · 3.51 KB

Get-SubNetwork.adoc

File metadata and controls

118 lines (101 loc) · 3.51 KB

Get-SubNetwork

Module: SubNetwork

Gets information about a sub-network.

Syntax

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>]

Description

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.

Examples

Example 1. Get sub-network information with network address and network bits
$NetworkInfo = Get-SubNetwork -Address 10.0.0.0 -Bits 8

This example calculates the network mask of the described network.

Example 2. Get sub-network information with address in network and network mask
$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.

Parameters

-Address

Specifies the IP address of the network, or an IP address within the network.

Type

Position

0

Default Value

None

Accept Pipeline Input

True

Accept Wildcard Characters

False

-Bits

Specifies the number of network bits.

Type

Position

1

Default Value

None

Accept Pipeline Input

False

Accept Wildcard Characters

False

-Mask

Specifies the network mask.

Type

Position

1

Default Value

None

Accept Pipeline Input

False

Accept Wildcard Characters

False

Inputs

You can pipe a string, byte[], UInt32, IPAddress object, or IpAddressBits object to this function.

Outputs

This cmdlet returns a PSCustomObject with the following structure:

{
    [IpAddressBytes] 'Network Address'
    [IpAddressBytes] 'Broadcast Address'
    [UInt32] 'Addresses Assignable'
    [IpAddressBytes] 'Network Mask'
    [byte] 'Mask Bits'
}