Skip to content

Instantly share code, notes, and snippets.

@gabrielrojasnyc

gabrielrojasnyc/IPAddress2

Last active Dec 11, 2015
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