Take the 2-minute tour ×

I need a Powershell script which helps me to create a folder on destination with one previous date.

Currently, I am using the code below. It helps me to create a folder on destination place with current date but I need folder with previous date.

$destination = "C:\abc"

Testing if the path Exist or not

md $destination -ErrorAction:SilentlyContinue 

Create a Test folder in destination path (name will be same as Zip file)

$folder = $destination + "\" + (get-date -Format yyyyMMdd) + "." 
$folderName = (get-date -Format yyyyMMdd) + "." md $folder
share|improve this question
What does this have to do with gmail? –  Ramhound Oct 9 '13 at 14:04
I'm a little confused. You just want to make a folder with the date in it's name? –  EBGreen Oct 9 '13 at 14:30
…or have its timestamp be before the current date? –  Synetech Oct 9 '13 at 16:00
add comment

1 Answer

up vote 0 down vote accepted

This line seems to do the trick:


Found it on Technet

share|improve this answer
PERFECT !! Thanks –  Ankit Oct 9 '13 at 19:27
add comment

Your Answer


