Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Use PowerShell to Find Files Newer than a Date

$
0
0

Summary: Use the Windows PowerShell to see if a file exists more recent than a certain date.

Hey, Scripting Guy! Question How can I use Windows PowerShell to see if a file more recent than a specific date exists in a folder?

Hey, Scripting Guy! Answer Use the Test-Path cmdlet, specify the folder, and use the –NewerThan parameter.
           The cmdlet expects a date in accordance with regional settings, for example:

PS C:\> Test-Path c:\fso -NewerThan 3/30/15

True

PS C:\> Test-Path c:\fso -NewerThan 4/3/15

False


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>