magritton
12/10/2015 - 11:17 PM

Powershell date add example

Powershell date add example

$i = 1
$x = 10
for($i = 0;$i -lt 70;$i++)
{
    $a = Get-Date
    $dynDate = $a.AddDays($x*-1)
    "LPQExportXML_v2 " + $dynDate.ToShortDateString() + " 10" | Out-File "C:\tmp\mdates.txt" -Append
    $x+=10
}