Powershell – How to check if file with desired creation time exists?

Question:

I’m using this script

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.

Answer:

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 😉 ).

Source:

Powershell – How to check if file with desired creation time exists? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply