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);
}
}

这段好像执行不成功

posted @ 2016-04-02 00:48  allenbackpacker  阅读(1019)  评论(0)    收藏  举报