< Back

New-IPCalcNetwork

Wed Jan 15, 2020 7:38 am

NAME New-IPCalcNetwork



SYNOPSIS

New-IPCalcNetwork returns an object that represents a network.





SYNTAX

New-IPCalcNetwork [-NetworkID] <String> [-NetworkMask] <String> [<CommonParameters>]



New-IPCalcNetwork [-NetworkID] <String> [-NetworkMaskLength] <Int32> [<CommonParameters>]





DESCRIPTION

New-IPCalcNetwork returns an object that represents a network. The resulting object will

contain the IP address identifying the network (AKA the subnet ID), the subnet

mask for the network, and the mask length (AKA CIDR suffix).





PARAMETERS

-NetworkID <String>

IP address string in dotted decimal notation (0.0.0.0) of an IP address in the

network to be returned. If this is not the actual network ID, the function will

calculate the correct IP and return it as part of the resulting object.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-NetworkMask <String>

Network mask string in dotted decimal notation (0.0.0.0) of the network to be

returned. If this is not a valid subnet mask, the function will error.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-NetworkMaskLength <Int32>

Integer in the range 0 - 32 representing the mask length of the network to be

returned.



Required? true

Position? 2

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String



System.Int32





OUTPUTS

System.Management.Automation.PSCustomObject





NOTES





This function is intended to be used as a tool for network planning. It should

help planners quickly split networks and determine if a particular IP address

belongs to that network.



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>New-IPCalcNetwork -NetworkID 192.168.1.0 -NetworkMask 255.255.255.0



Returns an object representing the new network with the provided IP address

and Mask









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>New-IPCalcNetwork -NetworkID 192.168.1.0 -NetworkMaskLength 24



Returns an object representing the new network with the provided IP address

and Mask of the specified length











RELATED LINKS