Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Move files older than x days and zip it

51 views
Skip to first unread message

jorge...@gmail.com

unread,
Oct 14, 2015, 1:40:41 PM10/14/15
to
Hi,

Help!!!!!

I am learning PS and I am looking to create a PS script that will move and zip files older than x days. I was thinking on doing it on one go. When the file is zipped it will be removed from the source.

Also to log this so I can understand if there were any missed files.

Is there a simple script to do this.

I have tried but I am struggling to remove the files from the source.

Thank you.
Jorge


Tom

unread,
Oct 15, 2015, 2:40:45 AM10/15/15
to
Can you post the script you got? Maybe I can help you with your code. You should also write any errors you got during script execution.

Rergards,
Tom

Marcel Müller

unread,
Oct 18, 2015, 2:49:27 AM10/18/15
to
If you are still learning, you should, as Tom pointed out, let us know
what you've got so far.

You should also let us know which version of Powershell Windows you are
using (some commands will not work in every version of either).

If you haven't done so, make yourself familiar with the following commands:

- get-childitem
- move-item
- remove-item (including parameter "-force")
- sort-object
- select-object (parameters "first" / "last")

Then read:
http://blogs.technet.com/b/heyscriptingguy/archive/2015/03/09/use-powershell-to-create-zip-archive-of-folder.aspx

If you then still have questions regarding your script, post it here and
aks specific questions.
0 new messages