Question: How To Create A Folder With Today’s Date Using PowerShell

This small cmdlet will show you how to create a folder with Today’s date using PowerShell, this very handy when creating backup script.

 

This is the script, the new folder will called Backup and the date and time, you can remove the Backup name if needed.

$folder = (Get-Date).tostring(” Backup dd-MM-yyyy-hh-mm-ss”)
New-Item -itemType Directory -Path “\\192.168.0.11\Backup” -Name $folder

 


Posted

in

,

by