Skip to content

Commit bac3ca2

Browse files
so that it doesnt fail in a container
1 parent d74d290 commit bac3ca2

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

source/internal/functions/NewGet-AllInstanceInfo.ps1

+8-5
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,14 @@ function NewGet-AllInstanceInfo {
284284
$authscheme = 'skipped'
285285
}
286286
}
287-
288-
if (-not(($__dbcconfig | Where-Object { $_.Name -eq 'skip.connection.ping' }).Value)) {
289-
$pingu = New-Object System.Net.NetworkInformation.Ping
290-
$timeout = 1000 #milliseconds
291-
$ping = ($pingu.Send($instance.ComputerName, $timeout)).Status
287+
if ($IsWindows) {
288+
if (-not(($__dbcconfig | Where-Object { $_.Name -eq 'skip.connection.ping' }).Value)) {
289+
$pingu = New-Object System.Net.NetworkInformation.Ping
290+
$timeout = 1000 #milliseconds
291+
$ping = ($pingu.Send($instance.ComputerName, $timeout)).Status
292+
} else {
293+
$ping = 'skipped'
294+
}
292295
} else {
293296
$ping = 'skipped'
294297
}

0 commit comments

Comments
 (0)