How to delete x days older folder

Advertisement

firekid
Joined:
Posts:
3

How to delete x days older folder

Here is a PowerShell script which can delete X days older folder. Can someone please write a script for WinSCP?
Get-ChildItem "folder path" -Recurse |
    Where-Object {($_.LastWriteTime -lt (Get-Date).AddDays(-1))} |
    Remove-Item -Recurse -Force -Confirm:$false

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum