Powershell Script That Generates/Creates Timestamp & Writes to Text File

by matt392 in Circuits > Software

93 Views, 0 Favorites, 0 Comments

Powershell Script That Generates/Creates Timestamp & Writes to Text File

PowershellTimestamp.png
PowershellTimestamp.png

Since Windows does not have a timestamp command like Linux (UNIX Epoch - number of seconds from January 1, 1970), this short Powershell script for Windows will create a unique timestamp number and then output it to a text file for use later.
For the attached Powershell script, download it and be sure to take off the ".txt" extension in order to run it from Powershell.

# Script creates timestamps using month, day, year, hours, minutes and seconds
# Writes it to a text file in the same directory
Get-Date -Format MMddyyyy-HHmmss | Out-File timestamp.txt