I am trying to use the Get-Date cmdlet to get yesterdays date. I have found the .AddDay(-1) command and that seems to work. The next thing i need to do is extract the date in YYMMDD format. This is that part i can not figure out how to do.
This is what i used to get todays date and the previous day.
$a = Get-Date
"Day: " + $a.Day
"Month: " + $a.Month
"Year: " + $a.Year
"Hour: " + $a.Hour
"Minute: " + $a.Minute
"Second: " + $a.Second
$b=$a.AddDays(-1)
"Day: " + $b.Day
"Month: " + $b.Month
"Year: " + $b.Year
"Hour: " + $b.Hour
"Minute: " + $b.Minute
"Second: " + $b.Second