Lately I’ve been engaged on a script which ought to verify the obtain pace. With PowerShell in fact. I want to share it right here.
The Code
Right here is my code for colleting details about my obtain pace and my hyperlink pace.
Enter the URL of the file to obtain and supply the placement of the downloaded file.
$File="https://patrick6649.information.wordpress.com/2022/08/lektion18.mp4"
$Location = Be a part of-Path -Path $House -ChildPath "Downloadslektion18.mp4"
$time = Measure-Command {
Begin-BitsTransfer -Supply $File -Vacation spot $Location
} | Choose-Object -ExpandProperty TotalSeconds
$filesize = (Get-ChildItem -Path $HomeDownloadslektion18.mp4).Size/1MB
$Pace = ($filesize / $time) * 8
Write-Output "Community Pace: $([math]::Spherical($Pace,2)) Mbit/sec"
Brief rationalization: A file can be downloaded from my homepage. It’s a video about Powershell Profiles in German language. In the course of the obtain of the file the method is measured with the Measure-Command cmdlet. On the finish we get the ultimate end result and the time it took to obtain the file.
Credit
Credit goes to the creator of this weblog posts who sparks the concept in to put in writing this script.
Have enjoyable measuring your obtain pace.
Printed by