Could any one help me with the below code which i have tried. We are new to powershell.
$Path = "E:\backup"$ZipTimestamp = Get-Date -format YYYYMM;
$MonthsBack = "-12"
$CurrentMonth = Get-Date.Month
$DatetoDelete = $ZipTimestamp + $CurrentMonth.Month($MonthsBack)
Get-ChildItem $Path -Recurse -include *_YYYYMM.zip | Where-Object { $_.LastWriteTime -lt $DatetoDelete } | Remove-Item