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. 

2 comments:

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

This blog is a treasure box full of power script knowledge. I am a computer science student and I find blogs like this one always helpful. I am saving this one for the future. There is never a bad time to read a useful blog, except when you are looking for Dissertation Consulting Services (like I am). Yet here I am, and I will keep coming back to your blog till my degree is complete.

Post a Comment

Popular Posts

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More