Powershell 2 - 一些关于日期 date 的
$Year = (Get-Date).year
$Month = (Get-Date).month
$Day = (Get-Date).day
$Year;
$Month;
$Day;
$path = "C:\Program Files (x86)\Jenkins\jobs";
Get-ChildItem $path | ForEach-Object -Process{
Write-Host ($_.creationtime);
if ($_ -is [System.IO.FileInfo] -and (($_.creationdate).month -ge $Month))
{
Write-Host ($_ + " is created in the month of " + $Month);
}
}
这段好像执行不成功
浙公网安备 33010602011771号