Search This Blog

特定日付の抽出

Command Sample

gci $ScreenPic| ?{ $_.LastWriteTime.toString("d") -eq (Get-Date -f "d") }
gci $ScreenPic| ?{ $_.LastWriteTime.toString("d") -eq "{0:d}" -f (Get-Date) }

Output

x> $ScreenPic
C:\Users\x\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets
x>
x> gci $ScreenPic| ?{ $_.LastWriteTime.toString("d") -eq (Get-Date -f "d") }


    Directory: C:\Users\x\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       2017/07/05     11:59         805584 14840aa64f46852221e317f6340c11c9e3e7f052962d7e82cd97443b96483d99
-a----       2017/07/05      7:59         432312 4fb8f9cfb2e50b10dd668292a9dc1743fcbf31b20d8ab7237247337668eed320
-a----       2017/07/05      7:59         549603 81fa1c04d8535409d845cf8710ab5e4e1b75724e0a50f31e24f4d555a7587ece


x> gci $ScreenPic| ?{ $_.LastWriteTime.toString("d") -eq "{0:d}" -f (Get-Date) }


    Directory: C:\Users\x\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       2017/07/05     11:59         805584 14840aa64f46852221e317f6340c11c9e3e7f052962d7e82cd97443b96483d99
-a----       2017/07/05      7:59         432312 4fb8f9cfb2e50b10dd668292a9dc1743fcbf31b20d8ab7237247337668eed320
-a----       2017/07/05      7:59         549603 81fa1c04d8535409d845cf8710ab5e4e1b75724e0a50f31e24f4d555a7587ece

x>

reference

about_Comparison_Operators