Skip to content

Instantly share code, notes, and snippets.

@tom-henderson
Created May 8, 2017 04:03
Show Gist options
  • Save tom-henderson/e3a98cbd71664aa10a667ef101492561 to your computer and use it in GitHub Desktop.
Save tom-henderson/e3a98cbd71664aa10a667ef101492561 to your computer and use it in GitHub Desktop.
$size = 20Mb # Size in bits, eg 1Mb / 1Gb
$dest = 'Z:\Destination\'
fsutil file createnew "C:\temp\test.dat" ($size)
$Write = Measure-Command { Copy-Item "C:\temp\test.dat" "$dest\test.dat" }
$WriteMbps = [Math]::Round( (($size * 8) / $w.TotalSeconds) / 1Mb, 2 )
rm "C:\temp\test.dat"
$Read = Measure-Command { Copy-Item "$dest\test.dat" "C:\temp\test.dat" }
$ReadMbps = [Math]::Round( (($size * 8) / $w.TotalSeconds) / 1Mb, 2 )
rm "$dest\test.dat"
Write-Output "Write speed $WriteMbps Mbps"
Write-Output "Read speed $ReadMbps Mbps"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment