Skip to content

Instantly share code, notes, and snippets.

@rickykaare
Created April 5, 2022 08:21
Show Gist options
  • Save rickykaare/70a1ec60518e7a4cb5791def2a1103ae to your computer and use it in GitHub Desktop.
Save rickykaare/70a1ec60518e7a4cb5791def2a1103ae to your computer and use it in GitHub Desktop.
Bash time command for PowerShell
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