NetworkHelper/Public/ConvertTo-BinaryIp.ps1

Function ConvertTo-BinaryIP
{
    
    
    [CmdLetBinding()]
    Param (
        [Parameter(Mandatory = $True, Position = 0, ValueFromPipeline = $True)]
        [Net.IPAddress]$IPAddress
    )
    
    Process
    {
        Return [String]::Join('.', $($IPAddress.GetAddressBytes() |
                    ForEach-Object -Process {
                    [Convert]::ToString($_, 2).PadLeft(8, '0')
                }
            ))
    }
}