Skip to content

Instantly share code, notes, and snippets.

@gabrielrojasnyc
Last active December 11, 2015 03:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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