Merge pull request #7 from AndrewDemski-ad-gmail-com/AndrewDemski-ad-gmail-com-patch-3
Update Test-Network.ps1pull/675/head
commit
e23829ab79
|
@ -7,18 +7,19 @@ function Test-Network {
|
||||||
|
|
||||||
#Test connectivity during 30 min then timeout
|
#Test connectivity during 30 min then timeout
|
||||||
Write-ToLog "Checking internet connection..." "Yellow"
|
Write-ToLog "Checking internet connection..." "Yellow"
|
||||||
While ($timeout -lt 1800) {
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$ncsiHost = Get-ItemPropertyValue -Path "HKLM:\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet" -Name ActiveWebProbeHost
|
$NlaRegKey = "HKLM:\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet"
|
||||||
$ncsiPath = Get-ItemPropertyValue -Path "HKLM:\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet" -Name ActiveWebProbePath
|
$ncsiHost = Get-ItemPropertyValue -Path $NlaRegKey -Name ActiveWebProbeHost
|
||||||
$ncsiContent = Get-ItemPropertyValue -Path "HKLM:\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet" -Name ActiveWebProbeContent
|
$ncsiPath = Get-ItemPropertyValue -Path $NlaRegKey -Name ActiveWebProbePath
|
||||||
} catch {
|
$ncsiContent = Get-ItemPropertyValue -Path $NlaRegKey -Name ActiveWebProbeContent
|
||||||
$ncsiHost = "www.msftconnecttest.com"
|
} catch {
|
||||||
$ncsiPath = "connecttest.txt"
|
$ncsiHost = "www.msftconnecttest.com"
|
||||||
$ncsiContent = "Microsoft Connect Test"
|
$ncsiPath = "connecttest.txt"
|
||||||
}
|
$ncsiContent = "Microsoft Connect Test"
|
||||||
|
}
|
||||||
|
|
||||||
|
While ($timeout -lt 1800) {
|
||||||
try {
|
try {
|
||||||
$ncsiResponse = Invoke-WebRequest -Uri "http://$($ncsiHost)/$($ncsiPath)" -UseBasicParsing -UserAgent ([Microsoft.PowerShell.Commands.PSUserAgent]::Chrome)
|
$ncsiResponse = Invoke-WebRequest -Uri "http://$($ncsiHost)/$($ncsiPath)" -UseBasicParsing -UserAgent ([Microsoft.PowerShell.Commands.PSUserAgent]::Chrome)
|
||||||
} catch {
|
} catch {
|
||||||
|
|
Loading…
Reference in New Issue