We’ve all been there — the pain of waiting for a page to load when it should have taken a millisecond, is very real. And then there’s the trial and error. Is it the router that’s causing the problem? The internet service provider? Maybe the computer just needs a restart.
Well, now you can remove the guesswork behind a slow connection with this useful internet speed test script. The script utilizes the Speedtest CLI by Ookla to measure internet connection performance metrics like download, upload, latency, and packet loss without relying on a web browser. This way, you can swiftly analyze and troubleshoot internet connectivity issues on your end user devices.
The script works by downloading the Speedtest CLI from the Ookla website, extracting and executing the file, and then displaying the results in your console. Once the script is executed, it will automatically delete the downloaded files and speedtest result stored in a text file.
The Script:
Atera does not guarantee the integrity, availability, security, virus-free, safety, lawfulness, non-infringement, rights’ status, or functionality of the scripts. The use of the shared scripts is at your own risk. Scripts are provided “AS IS”. *
$URL = "https://install.speedtest.net/app/cli/ookla-speedtest-1.2.0-win64.zip"
$output = "$env:TEMP\speedtest.zip"
$exe = "$env:TEMP\speedtest.exe"
$md = "$env:TEMP\speedtest.md"
$results = "$env:TEMP\Test.txt"
$params = "--accept-license --progress=no"
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri $URL -OutFile $output -Headers @{"Cache-Control"="no-cache"}
Expand-Archive -Path $output -DestinationPath "$env:TEMP\" -Force
# Runs Speedtest and outputs to a text file
Start-Process -FilePath $exe -ArgumentList $params -Wait -RedirectStandardOutput $results -WindowStyle Hidden
Get-Content $results
# Remove leftover files from program
Remove-Item -Path $output -Force
Remove-Item -Path $exe -Force
Remove-Item -Path $md -Force
Remove-Item -Path $results -Force
Will the script speed up a slow internet connection?
The script will not speed up a slow internet connection but it will perform an internet speed test to determine the speed and help you determine why it is slow. You can use the speed test results to identify what steps to take to try and speed up the connection.
Which operating systems does this script work on?
The script itself will conduct an internet speed test on Windows x64 devices.
Can I conduct an internet speedtest using the CLI on other operating systems?
While the script below is specifically for Windows devices, you can visit https://www.speedtest.net/apps/cli and follow the instructions to use the Speedtest CLI on macOS or Linux devices.
Technical Notes:
- Admin permissions needed to run this script.
- The URL on line 1 of the script may need to be updated when new versions of Speedtest CLI by Ookla are released. You can find the latest versions here
Explore our shared script library
The all-in-one IT management platform that will take your IT operations to the next level!