Thursday, December 21, 2017

Check Internet Connection with PowerShell

Check Internet Connection with PowerShell




$flagConnectionAtive=[Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]�{DCB00C01-570F-4A9B-8D69-199FDBA5723B}�)).IsConnectedToInternet

if ($flagConnectionAtive -eq "True")
{
 Write-Host "Internet connection is active"
}
else
{
 Write-Host "Internet connection is not active"
}

No comments:

Post a Comment