Need to Edit command to Delete files in S3 bucket older than 90 days using PowerShell(90days instead of specifying date)
$bucketname = "bucketname"
$key = aws s3api list-object-versions --bucket $bucketname --output json --query 'Versions[?LastModified<=`2022-08-26`].{VID:VersionId, Obj:Key}' | ConvertFrom-Json
Write-host "Removing desired Objects From: $bucketname" -foregroundcolor red
Foreach ($output in $key)
{
$delete = aws s3api delete-object --bucket $bucketname --key ($output).Obj --version-id ($output).VID --output text
$output.Obj
}