Wednesday, 11 January 2017

PowerShell Creating Time Stamp with date


##TIMESTAMP CREATION

$ScripName = "   "
$ydt = get-date -date $(get-date).adddays(-1) -format yyyyMMdd
$dt = date -f yyyyMMdd
$timeStamp= $(get-date -f MM-dd-yyyy_HH_mm_ss)
$path = "D:\\LOGS\$timeStamp"
if([IO.Directory]::Exists($path))
{
write-output "The folder exists"
}
else
{
$folCreate= New-item -type directory D:\LOGS\$(get-date -f MM-dd-yyyy_HH_mm_ss)
}

No comments:

Post a Comment

Git

1 git add ↳ It lets you add changes from the working directory into the staging area 2 git commit ↳ It lets you save a snapshot of currently...