A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
Hi.
Below PowerShell script that i used to solve my problem.
$SiteURL = "https://contoso.sharepoint.com/sites/Documents"
$FolderURL = "https://contoso.sharepoint.com/sites/Documents/Clients"
Connect-PnPOnline -Url $SiteURL
$startDate = Get-Date -Year 2016 -Month 1 -Day 1
$endDate = Get-Date -Year 2020 -Month 12 -Day 31
$ListFiles = Get-PnPFolderItem -FolderSiteRelativeUrl $FolderURL -ItemType File -Recursive
$ListFiles = Find-PnPFile -Folder $FolderURL -Match *.xml
$ListFiles = $ListFiles | Where-Object {($.TimeCreated.Date -le $endDate) -and ($.TimeCreated.Date -ge $startDate)}
$ListFiles.DeleteObject()
I just added this line:
$ListFiles = Get-PnPFolderItem -FolderSiteRelativeUrl $FolderURL -ItemType File -Recursive