Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (22 sloc) 515 Bytes
Function ConvertTo-BinaryAddress
{
[CmdletBinding()]
param (
[Parameter(
Mandatory = $true,
ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true
)]
[ipaddress]
$Address
)
process
{
$octets = $address.GetAddressBytes()
$result = foreach ($octet in $octets)
{
[convert]::ToString($octet, 2).PadLeft(8,'0')
}
Write-Output -InputObject $($result -join '.')
}
}