Created
April 5, 2022 08:21
-
-
Save rickykaare/70a1ec60518e7a4cb5791def2a1103ae to your computer and use it in GitHub Desktop.
Bash time command for PowerShell
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
function time { | |
$Command = "$args" | |
if ($Command -eq "") { | |
Write-Host "Usage: time <command>" | |
return; | |
} | |
Measure-Command { | |
Invoke-Expression $Command 2>&1 | out-default | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment