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. 

1 comments:

I regularly visit your site and find a lot of interesting information.Street View Online

Post a Comment

Popular Posts

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More