Powershel. Date next Saturday

Hi. I need to get date next Saturday in the format dd-MM-yy

I did so:

1..1000 | ForEach-Object {
$dte = (Get-Date).AddDays($_)

if($dte.DayOfWeek -eq 'Saturday')
{ $dte }
}

$date = ($dte)[0]
$date
  I get all the dates Saturdays, but I need variable only one date nearest Saturday in format:
Get-date -Format dd-MM-yy

Help please!

 
February 2nd, 2015 5:52am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics