Skip to content

Commit

Permalink
so that it doesnt fail in a container
Browse files Browse the repository at this point in the history
  • Loading branch information
SQLDBAWithABeard committed Mar 26, 2024
1 parent d74d290 commit bac3ca2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions source/internal/functions/NewGet-AllInstanceInfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,14 @@ function NewGet-AllInstanceInfo {
$authscheme = 'skipped'
}
}

if (-not(($__dbcconfig | Where-Object { $_.Name -eq 'skip.connection.ping' }).Value)) {
$pingu = New-Object System.Net.NetworkInformation.Ping
$timeout = 1000 #milliseconds
$ping = ($pingu.Send($instance.ComputerName, $timeout)).Status
if ($IsWindows) {
if (-not(($__dbcconfig | Where-Object { $_.Name -eq 'skip.connection.ping' }).Value)) {
$pingu = New-Object System.Net.NetworkInformation.Ping
$timeout = 1000 #milliseconds
$ping = ($pingu.Send($instance.ComputerName, $timeout)).Status
} else {
$ping = 'skipped'
}
} else {
$ping = 'skipped'
}
Expand Down

0 comments on commit bac3ca2

Please sign in to comment.