Function attempt #3
This commit is contained in:
parent
82bcdc77f6
commit
dc30a0bb61
@ -3,7 +3,7 @@ Function fDefaultGatewayCheck {
|
||||
Get-WmiObject -Class Win32_IP4RouteTable | where { $_.destination -eq '0.0.0.0' -and $_.mask -eq '0.0.0.0' } | Sort-Object nexthop, metric1, interfaceindex
|
||||
$vSCNextHop = (Get-WmiObject -Class Win32_IP4RouteTable | where { $_.destination -eq '0.0.0.0' -and $_.mask -eq '0.0.0.0' } | Sort-Object metric1 | select nexthop | Format-Wide | Out-String).trim()
|
||||
}
|
||||
fDefaultGatewayCheck()
|
||||
fDefaultGatewayCheck
|
||||
Test-Connection $vSCNextHop
|
||||
if ($? -eq $false)
|
||||
{
|
||||
@ -32,6 +32,6 @@ Test-Connection $vSCNextHop
|
||||
}
|
||||
else
|
||||
{
|
||||
fDefaultGatewayCheck()
|
||||
fDefaultGatewayCheck
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user