Skip to content

Commit

Permalink
Update ZNConnectivityTest.ps1
Browse files Browse the repository at this point in the history
dns update
  • Loading branch information
kenrward authored Jan 9, 2024
1 parent 34a5c3a commit af397d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Segment/Troubleshooting/ZNConnectivityTest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ foreach ($conn in $connections) {
$url = $conn.Url
$port = $conn.Port
$result = Test-NetConnection -ComputerName $url -Port $port
Resolve-DnsName $url
$dns = Resolve-DnsName $url -ErrorAction SilentlyContinue

# Check the result and print out failures
if (-not $result.TcpTestSucceeded) {
Write-Host "Failed to connect to $url on port $port"
$failedConnections += [PSCustomObject]@{ "Url" = $url; "Port" = $port }
}

if (-not $dns) {
Write-Host "Failed to resolve $url"
}
}

# Output the list of failed connections, if any
Expand Down

0 comments on commit af397d2

Please sign in to comment.