Hi,
I am trying to get a list of all folders in my music collection that do not have a file called ‘folder.jpg’. I have come up with this, but it still shows folders that do contain 'folder.jpg.
Clear-Host
$ThePath = "$Env:USERPROFILE\CloudStation" #Change this
Get-ChildItem -Path $ThePath -Recurse |
Where-Object { ($_.PSIsContainer -eq $True) -and ($_.Name -notlike "folder.jpg") } |
Sort-Object FullName | Select-Object FullName | Format-Table * -AutoSize
I know the issue is with the statement [$_.Name -notlike “folder.jpg”] as I think it is looking for a Folder named called folder.jpg, but I’m nt sure on what syntax I should be using.
Thanks
Tony