Skip to content

Commit aea5c82

Browse files
committed
Add UseBasicParsing param
1 parent 853c687 commit aea5c82

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

speedtest.ps1

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<#PSScriptInfo
22
3-
.VERSION 0.0.1
3+
.VERSION 0.0.2
44
55
.GUID a4af5e07-d626-4b97-b4d6-eef7265d1f7c
66
@@ -14,6 +14,7 @@
1414
1515
.RELEASENOTES
1616
[Version 0.0.1] - Initial Release.
17+
[Version 0.0.2] - Added UseBasicParsing parameter to Invoke-WebRequest commands to fix issue with certain systems.
1718
1819
#>
1920

@@ -31,7 +32,7 @@ Designed to use with short URL to make it easy to remember.
3132
.PARAMETER Help
3233
Displays the full help information for the script.
3334
.NOTES
34-
Version : 0.0.1
35+
Version : 0.0.2
3536
Created by : asheroto
3637
.LINK
3738
Project Site: https://github.com/asheroto/speedtest
@@ -42,7 +43,7 @@ param (
4243
)
4344

4445
# Version
45-
$CurrentVersion = '0.0.1'
46+
$CurrentVersion = '0.0.2'
4647
$RepoOwner = 'asheroto'
4748
$RepoName = 'speedtest'
4849
$PowerShellGalleryName = 'speedtest'
@@ -76,7 +77,7 @@ if ($PSBoundParameters.ContainsKey('Verbose') -and $PSBoundParameters['Verbose']
7677
# Scrape the webpage to get the download link
7778
function Get-SpeedTestDownloadLink {
7879
$url = "https://www.speedtest.net/apps/cli"
79-
$webContent = Invoke-WebRequest -Uri $url
80+
$webContent = Invoke-WebRequest -Uri $url -UseBasicParsing
8081
if ($webContent.Content -match 'href="(https://install\.speedtest\.net/app/cli/ookla-speedtest-[\d\.]+-win64\.zip)"') {
8182
return $matches[1]
8283
} else {
@@ -91,7 +92,7 @@ function Download-SpeedTestZip {
9192
[string]$downloadLink,
9293
[string]$destination
9394
)
94-
Invoke-WebRequest -Uri $downloadLink -OutFile $destination
95+
Invoke-WebRequest -Uri $downloadLink -OutFile $destination -UseBasicParsing
9596
}
9697

9798
# Extract the zip file

0 commit comments

Comments
 (0)