I have this PnP PowerSell script to get all files which have .lock
extension:-
$AllItems = Get-PnPListItem -List $Library -PageSize $BatchSize -Fields ID -ScriptBlock { Param($items) $global:counter += $items.Count; `
Write-Progress -PercentComplete ($global:Counter / ($Library.ItemCount) * 100) -Activity "Getting List Items of '$($_.Title)'" `
-Status "Processing Items $global:Counter to $($Library.ItemCount)";} | Where {$_.FileSystemObjectType -eq "File" -and $_.FileLeafRef -like "*.lock" }
Write-Progress -Activity "Completed Retrieving Items from List $($Library.Title)" -Completed
#Process All Files from the Library
$global:Counter = 1
ForEach($Item in $AllItems)
But I will not get any file. Any advice?