Skip to content

Instantly share code, notes, and snippets.

@stefan-huettemann
Last active May 29, 2018 12:35
Show Gist options
  • Save stefan-huettemann/ec0418df3f09b1159d2183a50054e8bf to your computer and use it in GitHub Desktop.
Save stefan-huettemann/ec0418df3f09b1159d2183a50054e8bf to your computer and use it in GitHub Desktop.
A random collection of power-shell commands - just to tease my memory
# remove old attachments to save disk space ...
Get-ChildItem –Path “E:\test” –Recurse | Where-Object CreationTime –lt (Get-Date).AddDays(-30) | Remove-Item –WhatIf
Get-ChildItem -Path "E:\test" -Recurse | Where-Object LastWriteTime -lt "2018-02-01" | Remove-Item –WhatIf
Get-ChildItem -Path "E:\test" -Recurse | Where-Object LastWriteTime -lt "2018-02-01" | Remove-Item
# list files
Get-ChildItem -Path "E:\test" -Recurse | Where-Object LastWriteTime -lt "2018-02-01"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment