Hello again have you ever wondered how long it took to execute a powershell script or command?
With a few lines of code we can retrieve that information from your history.
We can pull from history the last executed command and set it as a variable.
$command = Get-History -Count 1
Using builtin property’s EndExecutionTime and StartExecutionTime we can determine the execution time.
Now subtract EndExecution from StartExecutionTime.
$command.EndExecutionTime – $command.StartExecutionTime
Now go forth and execute.