I'm trying to get three different Timestamps from PowerShell as shown below. I've worked out the various commands using GET-DATE
to accomplish this but I'm not sure how to make a loop in PowerShell work with GET-DATE
and increment GET-DATE
with the formatting needed.
What I've got so far is below.
"1/26/2015 1:00 AM"
"2015-01-26"
"Sunday"
((Get-Date -Format "M/dd/yyyy") + " " + "1:00 am").ToUpper()
(Get-Date -Format "yyyy-MM-dd")
(Get-Date).DayOfWeek
for ($i = 0; $i -lt 7; $i++)
{
$d = ((Get-Date -Format "M/dd/yyyy").AddDays($i))
$d
}