2,187
edits
m (→IP Address: Added link to MS page) |
(Page deperciated) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Depreciated|category=Variables_(PowerShell)}} | |||
__TOC__ | __TOC__ | ||
Line 307: | Line 309: | ||
== Arrays == | == Arrays == | ||
<source lang="powershell"> | <source lang="powershell"> | ||
$array = @() | $array = @() # Create blank array | ||
$array += 34 | $array = @("one", "two", 3) # Create an array with some values | ||
$array += 34 # Add value to end of array | |||
</source> | </source> | ||
Line 462: | Line 465: | ||
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($ | if ( [System.Net.IPAddress]::TryParse($IP2test) ) { | ||
Write-Host "$ | Write-Host "$IP2test is a valid address" | ||
} | } | ||
</source> | </source> |