PowerShell TTUC #15 – File Name with Time Stamp

PoweShell TTUC (Tips, Tricks and Useful Commands) #16 – File Name with Time Stamp

File can be created with date / time suffix using the following syntax / commands:

New-item -type file -Name (“MyFile_$(Get-Date -f MM-dd-yyyy_hh-mm-ss).txt”) –force

New-item cmdlet will create a new file.  Get-data cmdlet will append date and time in MM-dd-yyyy_hh-mm-ss format. 

http://www.amazon.com/dp/1849687447/?tag=packtpubli-20

Powered by WPeMatico

Kurt Conway

That's IT!