I have a script to cleanup a folder regularly. Every month there are 3-4 sub folders created; what i am trying to accomplish is keep a single folder per month and delete the rest on that folder on every server. I was successfull with the script, but ran into below block.
My array looks as below;
$Array = ((Filepath,Timestamp2),(Filepath,Timestamp3),(Filepath,Timestamp1),(Filepath,Timestamp4))
What i would like to do is, sort elements in array by timestamp; how to do that? Please let me know if any other questions regarding this.
$Array=$Array|sort {$_[1]}