I'm using this script
$date = Get-Date
Get-Childitem -name | where {$_.CreationTime -eq "$date"}
but it doesn't work. All I need is to do a boolean check if there is a file created in specific date. Thank you.
Get-Date
gets the current date and time. If you compare a file's creation date with the current date and time you won't find any files (except you just have created one while retrieving the current date ;) ).
$today = (get-date).Date
Get-ChildItem | where { $_.CreationTime.Date -eq $today }
Get-ChildItem | where-object { $_.CreationTime.Date -match "2014" }
where 2014
is the year of creation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With