我正在使用这个脚本
$date = Get-Date
Get-Childitem -name | where {$_.CreationTime -eq "$date"}
但它不起作用。我需要做的只是做一个布尔检查是否有在特定日期创建的文件。谢谢你。
我正在使用这个脚本
$date = Get-Date
Get-Childitem -name | where {$_.CreationTime -eq "$date"}
但它不起作用。我需要做的只是做一个布尔检查是否有在特定日期创建的文件。谢谢你。
Get-Date
获取当前日期和时间。如果您将文件的创建日期与当前日期和时间进行比较,您将找不到任何文件(除非您在检索当前日期时刚刚创建了一个文件;))。
$today = (get-date).Date
Get-ChildItem | where { $_.CreationTime.Date -eq $today }
Get-ChildItem | where-object { $_.CreationTime.Date -match "2014" }
2014
创世年在哪里。