Thursday, July 24, 2014

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. 

0 comments:

Post a Comment

Popular Posts

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More