Created
October 18, 2019 22:29
-
-
Save SteveL-MSFT/dded71c054c491b2eda2546e2d88849c to your computer and use it in GitHub Desktop.
Startup perf test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$num = 50 | |
$ps = @("powershell.exe", "C:\Program Files\PowerShell\6\pwsh.exe", "C:\Program Files\PowerShell\7-preview\pwsh.exe") | |
$ps | ForEach-Object { | |
$thisps = $_ | |
$psv = & $thisps -nop -c '$psv = $psversiontable.gitcommitid; if ($psv -eq $null) { $psv = $psversiontable.psversion.tostring() }; $psv' | |
[int]$i = 0 | |
1..$num | ForEach-Object { | |
$i += (Measure-Command { | |
& $thisps -nop -c exit | |
}).TotalMilliseconds | |
} | |
[PSCustomObject]@{ | |
PSVersion = $psv | |
"Time (ms)" = $i / $num | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment