Difference between revisions of "Variables (PowerShell)"

Jump to navigation Jump to search
m
m (→‎IP Address: Added link to MS page)
m (→‎IP Address: Typo fix)
Line 462: Line 462:
To confirm a supplied address is valid...
To confirm a supplied address is valid...
<source lang="powershell">
<source lang="powershell">
if ([System.Net.IPAddress]::TryParse($IP-to-test) {
if ( [System.Net.IPAddress]::TryParse($IP2test) ) {
     Write-Host "$IP-to-test is a valid address"
     Write-Host "$IP2test is a valid address"
}
}
</source>
</source>

Navigation menu