我想弄清楚什麼是最好的方式來調用需要日期範圍參數(例如:20130801-20130815)的exe文件,然後循環它,使其最小化15幾天,然後用新的日期範圍調用exe。循環到從當前日期減去15天
我想過使用一個做,但我不知道如何(新的PowerShell /編程),但我敢肯定,這是遠離正確的方法:)。我剛開始弄清楚這一點,所以提前感謝任何/所有的幫助。
do {
$startDate = (Get-Date).adddays(-34)
$requireddate = some date that is set ad-hoc
$startdate.ToString("yyyyMMdd")
#[datetime]::parseexact($startdate,"MMddyyyy",$null)
Call THE EXE at this point with the parameters $startdate and $enddate
$enddate = $startdate.AddDays(-15)
write-host $enddate.ToString("yyyyMMdd")
}
until ($enddate -eq $requireddate)