Last active
December 11, 2015 03:49
-
-
Save gabrielrojasnyc/475c0d448533e93715c3 to your computer and use it in GitHub Desktop.
Fins IP address available and output to an object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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