Doing a speedtest with PowerShell

Hi guys!

I searched a lot on Google, but most scripts are not working or only showing the link speed from the network card (100/1000). I would like to do a speedtest with PowerShell so I can include the internet speed in my report. Is that possible?
I’m still a newbie on PowerShell (19 years old), so I’m sorry if this is easy to make. :slight_smile:


Best regards,


Before considering implementation for a speedtest, you need to define what you mean when you say network speed. How do you define network speed (is it pure upload/download speed for TCP communication between computer A and B or is it something else you’re looking for) and between which endpoints (exactly which computers are you going to use and are they two computers on same local network, other country, other side of the globe)?

Hi Robert. Thanks for your answer. It must be something like So it’s pure upload and download speed between a (public, maybe if possible) server.

To calculate pure upload and download speed is pretty easy, especially if you have control over both the server and the client. Just make UploadFile and DownloadFile requests (which you can do using the Invoke-WebRequest cmdlet or the HttpClient or WebClient .NET classes), measure the time it takes and divide the file size with the time measured. Do be sure to upload both small and slightly larger files, to account for connection opening and similar.

However, if the server is not yours and you keep downloading and uploading a lot of large dummy files (especially if you run it from several different machines at the same time) it could be considered less nice (bordering on DOS-attack, possibly?), in which case I suggest contacting the server owner before doing any such thing.

OK, that’s also possible indeed. I’d hoped for something like in PowerShell, but that’s not possible so I have to make my own speedtest. :slight_smile: Thanks for the commands and help! is a flash application, so it’s not really a great fit for controlling via PowerShell. In theory you could automate the webbrowser to start the test and once it’s done somehow get the data out of the flash application (either if it’s available through some javascript calls to the flash API, peeking into the flash gui objects or by doing OCR on the flash GUI displaying the numbers). I do, however, believe that this would be a lot more difficult (have never tried controlling flash applications from PowerShell so I can’t make any educated comments on the difficulty level) than just making the calculations yourself (which should be pretty easy, once you know which server you want to communicate with).

No indeed. Thanks for the help Robert!