Enable Check-PSGalleryApiAvailability on Linux

Updating Enable Check-PSGalleryApiAvailability on Linux to use
[System.Net.NetworkInformation.NetworkInterface]::GetIsNetworkAvailable()
This commit is contained in:
Manikyam Bavandla 2016-07-18 19:28:02 -07:00
parent 258fd792fc
commit 7c32155421

View file

@ -6040,10 +6040,15 @@ function Check-PSGalleryApiAvailability
{
$connected = Microsoft.PowerShell.Management\Test-Connection -ComputerName $microsoftDomain -Count 1 -Quiet
}
else
elseif(Get-Command NetTCPIP\Test-Connection -ErrorAction Ignore)
{
$connected = NetTCPIP\Test-NetConnection -ComputerName $microsoftDomain -InformationLevel Quiet
}
else
{
$connected = [System.Net.NetworkInformation.NetworkInterface]::GetIsNetworkAvailable()
}
if ( -not $connected)
{
return