< Back

ConvertTo-Mask

Wed Jan 15, 2020 2:22 am

NAME ConvertTo-Mask



SYNOPSIS

Convert a mask length to a dotted-decimal subnet mask.





SYNTAX

ConvertTo-Mask [-MaskLength] <Byte> [<CommonParameters>]





DESCRIPTION

ConvertTo-Mask returns a subnet mask in dotted decimal format from an integer value ranging between 0 and 32.



ConvertTo-Mask creates a binary string from the length, converts the string to an unsigned 32-bit integer then

calls ConvertTo-DottedDecimalIP to complete the operation.





PARAMETERS

-MaskLength <Byte>

The number of bits which must be masked.



Required? true

Position? 2

Default value 0

Accept pipeline input? true (ByValue)

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.Int32





OUTPUTS

System.Net.IPAddress





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



PS C:\\>ConvertTo-Mask 24



Returns the dotted-decimal form of the mask, 255.255.255.0.











RELATED LINKS