PoshCode Archive  File History

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

History of Time-Stamp.ps1

2018-06-10
13:15
This is a very simple function that returns a DateTime time stamp. I use it in scripts for noting times when actions occur like this Write-Host “$(Time-Stamp): Attempting to create directory.”; It’s a lot shorter than writing out the whole thing. You can also alias it to simplify the process: New-Alias -Name ts -Value Time-Stamp;. This way I use Write-Host “$(ts): Attempting to create directory.”; It outputs: 2011.07.17 05:01:10: Attempting to create directory. You can alter the value in the ToString to change the way the time stamp is formatted. file: [0c9d643d1b] check-in: [32c218cf20] user: Will Steele branch: trunk, size: 977 Added