Lambda to archive files which are 30 olds

I am trying to write a function to archive files which are older than 30 days in S3 bucket … I am doing in power shell .

Can anyone share their ideas if same was implemented in the past ?