Skip to content

Instantly share code, notes, and snippets.

@sandorjanssen
Created July 13, 2017 13:36
Show Gist options
  • Save sandorjanssen/61efaa6ee480af7692a5183c7007e846 to your computer and use it in GitHub Desktop.
Save sandorjanssen/61efaa6ee480af7692a5183c7007e846 to your computer and use it in GitHub Desktop.
Get filenames from files in serveral subfolders that have a specific range for the LastWriteTime property
# Get filenames from files in serveral subfolders that have a specific range for the LastWriteTime property
$path = "FileSystem::\\path\to\files\**\in\several\subfolders"
$start = Get-Date -Date "2017-06-27"
$end = $start.AddDays(1)
Get-ChildItem -Path $path -Recurse | `
Where-Object { $_.LastWriteTime -ge $start -and $_.LastWriteTime -le $end } | `
Select-Object { $_.Name }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment