Skip to content

Instantly share code, notes, and snippets.

@gabrielrojasnyc
Last active December 11, 2015 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabrielrojasnyc/475c0d448533e93715c3 to your computer and use it in GitHub Desktop.
Save gabrielrojasnyc/475c0d448533e93715c3 to your computer and use it in GitHub Desktop.
Fins IP address available and output to an object
$Vlan = 1..3 | ForEach-Object {
if(!(Test-Connection 10.0.100.$_ -count 1 -Quiet)) {
[pscustomobject]@{Name = "Available"; Value = "10.0.100.$_"}
}
else {
[pscustomobject]@{Name = "Not Available"; Value = "10.0.100.$_"}
}
}
$vlan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment