remove files older than days
Hallo,
I would really be gratefull if you can help me with the below question:
I have made a script using powershell to zip files and upload it to an SFTP server and then deleting the local zip file, everything is working great.
My question is, after uploading the file I want to check all the files in the remote directory (which holds the zip files) and delete the ones which are older than 15 day.
I think I should use the $session.RemoveFiles(" ")
But how im going to difine the "15 days", it can be done by WinSCP commands but I want it by Powershell so the whole script will be in one language.
Thank you very much for your advice! :idea:
I would really be gratefull if you can help me with the below question:
I have made a script using powershell to zip files and upload it to an SFTP server and then deleting the local zip file, everything is working great.
My question is, after uploading the file I want to check all the files in the remote directory (which holds the zip files) and delete the ones which are older than 15 day.
I think I should use the $session.RemoveFiles(" ")
But how im going to difine the "15 days", it can be done by WinSCP commands but I want it by Powershell so the whole script will be in one language.
Thank you very much for your advice! :idea: