This topic contains 6 replies, has 2 voices, and was last updated by
February 10, 2014 at 5:28 am #13031
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. 🙂
February 11, 2014 at 4:21 pm #13041
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)?
February 12, 2014 at 2:26 am #13043
Hi Robert. Thanks for your answer. It must be something like speedtest.net. So it's pure upload and download speed between a (public, maybe speedtest.net if possible) server.
February 12, 2014 at 2:45 am #13044
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.
February 12, 2014 at 3:00 am #13045
OK, that's also possible indeed. I'd hoped for something like Speedtest.net in PowerShell, but that's not possible so I have to make my own speedtest. 🙂 Thanks for the commands and help!
February 12, 2014 at 3:16 am #13046
February 12, 2014 at 4:48 am #13048
No indeed. Thanks for the help Robert!
The topic ‘Doing a speedtest with PowerShell’ is closed to new replies.