I'm measuring how long it takes to download a file, then doing some math to figure out the speed of the download.
I'm finding that by using Powershell, I'm getting results of around 6.5MB/s. If I us iPerf or the locally hosted Speedtest Mini, I get 18MB/s.
What's with this discrepancy?
#set size in KB (KiloBytes)
$size = 30885
#Time how long it takes to download the file to null
$t = Measure-Command {invoke-webrequest http://IISSRV01:9001/speedtest/random4000x4000.jpg | out-null}
#multiply integer KB size by 8 to get kb, times integer TotalMilliseconds of download, times 1000 to get kbps
[int] $size * 8 / [int] $t.TotalMilliseconds *1000