< Back

ConvertTo-DottedDecimalIP

Wed Jan 15, 2020 2:21 am

NAME ConvertTo-DottedDecimalIP



SYNOPSIS

Converts either an unsigned 32-bit integer or a dotted binary string to an IP Address.





SYNTAX

ConvertTo-DottedDecimalIP [-IPAddress] <String> [<CommonParameters>]





DESCRIPTION

ConvertTo-DottedDecimalIP uses a regular expression match on the input string to convert to an IP address.





PARAMETERS

-IPAddress <String>

A string representation of an IP address from either UInt32 or dotted binary.



Required? true

Position? 2

Default value

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





OUTPUTS

System.Net.IPAddress





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



PS C:\\>ConvertTo-DottedDecimalIP 11000000.10101000.00000000.00000001



Convert the binary form back to dotted decimal, resulting in 192.168.0.1.









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



PS C:\\>ConvertTo-DottedDecimalIP 3232235521



Convert the decimal form back to dotted decimal, resulting in 192.168.0.1.











RELATED LINKS