Skip to content

Instantly share code, notes, and snippets.

@jasonadsit
Created January 25, 2021 19:38
Show Gist options
  • Save jasonadsit/780143c4c3ee6e16f38ff80c26ad2bb8 to your computer and use it in GitHub Desktop.
Save jasonadsit/780143c4c3ee6e16f38ff80c26ad2bb8 to your computer and use it in GitHub Desktop.
filestuff.ps1
$Days = (Get-Date).AddDays(-7)
Get-ChildItem -Path \\some\path,\\some\other\path -Recurse -ErrorAction SilentlyContinue |
Where-Object { $_.LastWriteTime -ge $Days } |
Select-Object -Property @{n='LastWriteTime';e={[string]$_.LastWriteTime.GetDateTimeFormats('s')}},FullName |
ForEach-Object { "$($_.LastWriteTime)|$($_.FullName)" } |
Tee-Object -FilePath "$HOME\Downloads\$(Get-Date -Format yyyyMMdd)-Files.txt" -Append
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment