Functions/Data/Test-IPAddress.ps1
<#
.Synopsis Test a string to figure out if it's a valid IP addrss .DESCRIPTION Test a string to figure out if it's a valid IP addrss .EXAMPLE Test-IPAddress -IP 192.160.1.1 .EXAMPLE Another example of how to use this cmdlet #> function Test-IPAddress { [CmdletBinding()] Param ( # IP address to Validate [Parameter(Mandatory=$true)] [string] $IP ) try { $TEST = ($IP -match [ipaddress]$IP) $TEST } catch { $false } } |