Since this is a function, after you loaded the code, you can call Measure-NetworkSpeed and get the result. $SpeedMbps do some simple math to calculate the Mbps of the download. $TimeTaken is where I measure the totalt time it takes to download the test file into the temporary location. In the $TempFile I specify the path to the TEMP environment where I can download the test file to. If you want to see what's in the class, you can run $WebClient | Get-Member. Net.WebClient have many methods to use if you want to download stuff. Next, I specify $WebClient and that I want to use the object Net.WebClient class. Function Measure-NetworkSpeed Mbit/sec" -f ($SpeedMbps)Īs you can see, first I specify what to test against. Also, sunet have an exceptionally good, fast, and stable internet connection so I figure they are an excellent choice to test against. I found a 10MB file on, which is the university network in Sweden, where many clients are. This is because if a client has a slow uplink to internet, it's not a clever idea to choke their already limited speed with large test files. Measure-Commandįirst, I made a function which measure how long it takes to download a 10MB file. This way we can notice if they have a problem even before they contact us. We handle the network for many clients, and this helps us measure and see that our clients' networks deliver the speed that is expected. But of course, you can! I was tasked to create a script that measure the performance of the internet connection using Powershell.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |