From bac3ca22373cd3ccd5e86ec9de5d89965ebe5870 Mon Sep 17 00:00:00 2001 From: Rob Sewell Date: Tue, 26 Mar 2024 14:00:31 +0000 Subject: [PATCH] so that it doesnt fail in a container --- .../internal/functions/NewGet-AllInstanceInfo.ps1 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/source/internal/functions/NewGet-AllInstanceInfo.ps1 b/source/internal/functions/NewGet-AllInstanceInfo.ps1 index d6c5a16f..918404ab 100644 --- a/source/internal/functions/NewGet-AllInstanceInfo.ps1 +++ b/source/internal/functions/NewGet-AllInstanceInfo.ps1 @@ -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' }