wzhouwzhou / one-line-wonders

OneLineWondersCode | 1000+ Commits | 279/300 One Liners | 200+ Forks | Actively maintained open-source collection of "one-line" programs performing various tasks in different languages
https://hacktoberfest2018.suya.moe
GNU General Public License v3.0
96 stars 192 forks source link

Getting duration of the last command (PowerShell) #441

Open Windos opened 3 years ago

Windos commented 3 years ago

Please describe your program and how to run it.

This file can be "dot sourced" in a PowerShell prompt:

. .\path\last_command_runtime.ps1

Or it's content can be types interactively at the prompt.

It will tell you how long the previous command took to execute.

The file also includes, in comments, the non-one-line version and an even shorter option for PowerShell 7.0 (maybe 6.0, but haven't tested) and above.


What Programming Language?

PowerShell 🤘