mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-24 02:04:07 +08:00
Enable Check-PSGalleryApiAvailability on Linux
Updating Enable Check-PSGalleryApiAvailability on Linux to use [System.Net.NetworkInformation.NetworkInterface]::GetIsNetworkAvailable()
This commit is contained in:
parent
258fd792fc
commit
7c32155421
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user