{"id":9834,"date":"2024-07-02T05:02:49","date_gmt":"2024-07-02T05:02:49","guid":{"rendered":"https:\/\/cheapwindowsvps.com\/blog\/how-to-test-your-internet-speed-using-windows-command-prompt-and-powershell\/"},"modified":"2025-01-20T10:22:31","modified_gmt":"2025-01-20T10:22:31","slug":"how-to-test-your-internet-speed-using-windows-command-prompt-and-powershell","status":"publish","type":"post","link":"https:\/\/cheapwindowsvps.com\/blog\/how-to-test-your-internet-speed-using-windows-command-prompt-and-powershell\/","title":{"rendered":"How to Test Your Internet Speed Using Windows Command Prompt and PowerShell"},"content":{"rendered":"<p><p>Many online services allow you to test your Internet connection speed in real-time. If you need to regularly collect Internet connection speed metrics from your provider for monitoring, you can use the popular <strong>Speedtest<\/strong> console client from Ookla. Let\u2019s look at how to measure the speed of an Internet connection using the Windows command prompt or a PowerShell script.<\/p>\n<\/p>\n<p><p>Download the console <strong>speedtest.exe<\/strong> tool for Windows from <a href=\"https:\/\/www.speedtest.net\/apps\/cli\" rel=\"nofollow noopener\" target=\"_blank\">https:\/\/www.speedtest.net\/apps\/cli<\/a> and extract it to a local directory.<\/p>\n<\/p>\n<p><p>To automatically test network download and upload speeds to the nearest Speedtest service location, run the command<\/p>\n<\/p>\n<p><p><code>.speedtest.exe<\/code><\/p>\n<\/p>\n<p><p>The tool returns download and upload speeds (in Mbps), network latency from your computer to the nearest Speedtest server. Since there are many SpeedTest locations worldwide, this will be the speed of your internet connection.<\/p>\n<\/p>\n<p><p>You can manually select the ISP, country, and city to test your Internet connection speed to. List the nearest test points and copy the ID:<\/p>\n<\/p>\n<p><p><code>.speedtest.exe -L<\/code><\/p>\n<\/p>\n<p><p>Run the speed test against the target server:<\/p>\n<\/p>\n<p><p><code>.speedtest.exe -s 11787<\/code><\/p>\n<\/p>\n<p><p>The speedtest command can return results in structured formats (CSV, JSON, TSV), which is useful if you need to extract additional data from the results or send the test result to the monitoring system.<\/p>\n<\/p>\n<p><p>For example, you can use a PowerShell script to get the results of an Internet speed test:<\/p>\n<\/p>\n<p><pre>$speedtestcmd = &amp; \"C:psspeedtest.exe\" --accept-license -s 37149 -f json<\/p><p>$speedtestresult=ConvertFrom-Json $speedtestcmd<\/p><p>$result=[PSCustomObject]@{<\/p><p>   Download = [math]::round($speedtestresult.download.bandwidth\/1MB, 5)*8<\/p><p>   Upload = [math]::round($speedtestresult.upload.bandwidth\/1MB, 5)*8<\/p><p>}<\/p><p>$result<\/p><p><\/pre>\n<\/p>\n<p><div> The speedtest command returns a <a href=\"https:\/\/woshub.com\/powershell-read-modify-json-object\/\" rel=\"nofollow noopener\" target=\"_blank\">JSON object that can be processed using PowerShell<\/a>. Extract the download and upload speed values from JSON and convert the values from bits to megabits.<\/div>\n<\/p>\n<p><p>You can send the Internet speed test results to your monitoring system as metrics (<a href=\"https:\/\/woshub.com\/zabbix-powershell-scripts\/\" rel=\"nofollow noopener\" target=\"_blank\">Getting data into Zabbix from a PowerShell script<\/a>).<\/p>\n<\/p>\n<p><p>On a local network, you can use the <a href=\"https:\/\/woshub.com\/testing-network-bandwidth-using-iperf\/\" rel=\"nofollow noopener\" target=\"_blank\">iperf<\/a> tool to test the network bandwidth between two machines.<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Many online services allow you to test your Internet connection speed in real-time. If you need to regularly collect Internet connection speed metrics from your provider for monitoring, you can use the popular Speedtest console client from Ookla. Let\u2019s look at how to measure the speed of an Internet connection using the Windows command prompt [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":9835,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117,98,99],"tags":[],"class_list":["post-9834","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","category-windows-10","category-windows-11"],"_links":{"self":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/posts\/9834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/comments?post=9834"}],"version-history":[{"count":2,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/posts\/9834\/revisions"}],"predecessor-version":[{"id":10377,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/posts\/9834\/revisions\/10377"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/media\/9835"}],"wp:attachment":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/media?parent=9834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/categories?post=9834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/tags?post=9834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}