Skip to content

Instantly share code, notes, and snippets.

@SQLvariant
Created March 19, 2019 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SQLvariant/470e35101ef37bab64e08d5a1b46d1ff to your computer and use it in GitHub Desktop.
Save SQLvariant/470e35101ef37bab64e08d5a1b46d1ff to your computer and use it in GitHub Desktop.
Simple function to give you the duration of all command history in PowerShell
function Get-History2
{
Get-History |
SELECT Id, @{Label="TotalRunningTime";Expression={$_.EndExecutionTime - $_.StartExecutionTime}}, CommandLine, ExecutionStatus, StartExecutionTime, EndExecutionTime
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment