Skip to content

Instantly share code, notes, and snippets.

@SQLvariant
Created March 19, 2019 17:28
Show Gist options
  • Select an option

  • Save SQLvariant/470e35101ef37bab64e08d5a1b46d1ff to your computer and use it in GitHub Desktop.

Select an option

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