The following PowerShell code can be used for this purpose.
1: $path = 'C:\Family\powershell';
2: $targetDate = '2018-04-09';
3:
4: Get-ChildItem -Path $path -File |
5: Where-Object {$_.LastWriteTime.ToString("yyyy-MM-dd") -eq $targetDate}
6:
7: Write-Host 'All done now';
8:
In this example, I'm looking for files with a LastWriteTime of 2018-04-09. All other files will be ignored.
Keywords: powershell files lastwritetime target date
No comments:
Post a Comment