Idea is to delete all files except 1st and 15th at the month.
But when i run it i see files at other days too
$Path = "D:\test"
$Daysback = -15
$CurrentDate = Get-Date
$DatetoDelete = $CurrentDate.AddDays($Daysback)
Get-ChildItem $Path -Recurse |
? { ($_.LastWriteTime -lt $DatetoDelete) -and !($_.LastWriteTime.Day -eq 1) -and !($_.LastWriteTime.Day -eq 15)}|Remove-Item -Recurse -Confirm:$false -Force