Thursday, July 24, 2014

Home / PowerShell TTUC #15 – File Name with Time Stamp

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. 

SS

Santhosh Sivarajan

Microsoft MVP · Identity & Cybersecurity Architect

Santhosh has 30+ years of hands-on enterprise experience in Identity and Access Management, Microsoft Entra ID, Active Directory, Microsoft 365 and Zero Trust architecture. He is the author of two books on Windows Server and security, and leads consulting, assessments and training at SAG Business Group.

9 comments:

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.

Playing the Judi Online slots is a dream for me and my wife both wins and play huge amount of games.

To be completely honest, I came on your website when looking for a service to assist with university assignments. I'm not sure how I ended up on your website because I can't seem to find anything about Master thesis services. Would you kindly confirm it? My need for it is acute.

This is amazing blog! I have go through all the content of this blog.This is really helpful and informative for me.If you are looking to buy an online Best Thesis Editing Service at a cheap rate.

Thank you for the tip and trick!
Regards: If you have any problems regarding Senior Support, I can solve the issue through https://4thquarterrealtygroup.org.

I visit this site because it is interesting. As a education consultants in pakistan I want to know more about syntax and commands.
Thank you.

I have learned alot in this blog.This is really helpful and informative for me.If you are looking to buy an online mens shalwar kameez for men at a cheap rate.

Great post! Incorporating time stamps into file names is such a handy technique, especially in BI development. It not only helps in version control but also ensures a clear chronology of file updates, which is crucial for maintaining an organized and efficient BI development workflow. Thanks for sharing this practical PowerShell tip - definitely adding it to my toolkit!

Accounting for investments involves specific rules for derecognition and disposal, ensuring proper treatment of gains or losses.

Post a Comment

Popular Posts
Workstation Trust Relationship Issue Issue: You receive the following error message, when you try to login to the domain.  The security database on the server does not have ... ADMT Service Account - Permission and Configuration The ADMT service account needs to have proper permission in source and target domains.  You don’t need to use 2 separate accounts.  You can ... My First Peek into Microsoft Exchange 2010 By Santhosh Sivarajan Before I really dive into Exchange 2010, I thought I would install and play with it first. I took some screen shots and notes during the ins... ObjectSID and Active Directory What is an objectSID in Active Directory? When a new object is created in Active Directory, Domain Controller assigns a unique value used ... AD Group Report - List Group Members in Active Directory–PowerShell Script Updated Script - http://portal.sivarajan.com/2011/10/search-ad-collect-local-admin-group.html Script #1 This script... Add Users to a Group–PowerShell Script Purpose – Add users to a group from an input file – PowerShell V2 Script.  Input file – Input file (Users.csv) contains samAccountName in... User Account Migration and Merging – Part I (ADMT) Part I - User Account Migration and Merging Using ADMT Part II - User Account Migration and Merging Using QMM pre-creating user account ... User Account Migration and Merging – Part II (Quest Migration Manager) Part I - User Account Migration and Merging Using ADMT Part II - User Account Migration and Merging Using QMM Pre-creating user account in... Delete Stale or Inactive Computer Accounts from Active Directory Here is an easy way to identify and delete inactive or stale computers in an Active Directory environment.  Using the dsquery command you c... Converting PowerShell (PS1) to EXE / Standalone Application As we know, there many applications available to convert a PowerShell file to a standalone executable file.  Based on my experience, PowerSh...