Posted in
Windows Powershell |
No Comment | 20,719 views | 27/05/2013 10:35
I’ll show you how to get total elapsed time for processes in same output with using Label and Expression function of PowerShell. You can see the command below:
(Get-Process | ft Name,@{label="Elapsed Time";expression={[System.Math]::Round(((Get-Date)-$_.StartTime).TotalSeconds)}}) |
(Get-Process | ft Name,@{label="Elapsed Time";expression={[System.Math]::Round(((Get-Date)-$_.StartTime).TotalSeconds)}})
You can execute additional commands with Expression function in same PowerShell command.