Wednesday, November 26, 2014

Testing IP address validity in PowerShell

There may come a time when you want to test if an IP-address is valid or not. Here's a simple PowerShell function that will do just that and return true or false.

Function Test-IPAddress {
    [CmdletBinding()]
    Param (
        [Parameter(Mandatory=$True, ValueFromPipelineByPropertyName=$True, Position=0)]
        [String]$IPAddress
    )
   
    Begin {
    }

    Process {
        Return ($IPAddress -As [IPAddress]) -As [Bool]
    }

    End {
    }
}



3 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. Permainan Sabung Ayam Online di Agen BOLAVITA , dengan minimal deposit hanya Rp 25.000 saja , dan minimal betting hanya Rp 10.000 saja sudah bisa mainkan permainan Sabung Ayam

    http://agenpialadunia2018-blog.logdown.com/posts/7917423-bolavita-and-alan-penjudi-online-untuk-menang

    Produk Kami Judi Sabung Ayam Online S128, SV388.

    https://www.sateayam.biz/
    https://m1.hj128.pw
    Daftar Sabung Ayam sv388
    Daftar Sabung Ayam Online S128

    Agen Sabung Ayam Online Bolavita Banyak Bonus dan Promo Mari Bergabung :

    Promo Sabung Ayam Terbaru 8x Win Beruntun.
    Bolavita Bisa Deposit Via OVO & GO-Pay.
    Sabung Ayam Deposit Via Pulsa XL & TSEL 25rb.

    Promo Promo BOLAVITA

    Telegram : +62812-2222-995
    Wechat : Bolavita
    WA : +62812-2222-995
    Line : cs_bolavita

    ReplyDelete