Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Address CIDR Description VLAN
- ------- ---- ----------- ----
- 10.15.10.0 24 DMZ 3000
- 10.15.11.0 24 Voice 3010
- 10.15.12.0 24 Wireless 3020
- 10.15.13.0 28 Management 3030
- ... ... ... ...
- $testCon = Test-Connection hostname -Count 1
- $allSubnets | ForEach-Object {
- if((checkSubnet -addr1 ('{0}/{1}' -f $_.Address, $_.CIDR) -addr2 $testCon.IPV4Address.IPAddressToString).Condition -eq $true)
- {
- [pscustomobject]@{
- subnet = ('{0}/{1}' -f $_.Address, $_.CIDR)
- desc = $_.Description
- }
- }
- }
Add Comment
Please, Sign In to add comment