Thanks guys, based upon your leads I have found the answer.
Get-IndexedItem does what I am asking for. I used the following parameters:
Get-IndexedItem -Path d:/audio/music -Recurse -Filter "Kind = 'Music' AND Genre = 'Folk' AND RatingText = '4 Stars' " | copy -destination f:\SearchIndex\Folk
I will then mirror the output folder to my NAS using Robocopy.
The only problem remaining is that I cannot get the AND/OR SQL combination to work in the Get-IndexedItem 'Filter' parameter. As in:
-Filter "Kind = 'Music' AND Genre = 'Folk' AND (RatingText = '4 Stars' OR RatingText = '5 Stars')"
I believe that is valid in SQL but causes an error when used in the Get-IndexedItem commandlet.
Thanks again, David
Powershell - how to interrogate Windows Index file
On my W10 desktop I have about 3000 mp3 files in folders organised by Genre. I would like to mirror all the files which have a Rating of >3 to my NAS which runs a media server.
I understand that because mp3 files are compressed it would not be practical to search each file for the Rating. That it would be better to search through the Windows Index file.
Then for each music entry in Windows Index with a Rating >3, run Robocopy in Mirror mode to build a mirror on the NAS - organised by Genre.
I have written about half a dozen Powershell programs so am still a novice.
Can anyone give me a starter for how to search the Windows Index file and then generate a Robocopy command?
-
David Stokes 96 Reputation points
2020-07-26T11:44:38.053+00:00
5 additional answers
Sort by: Most helpful
-
Rich Matheisen 46,801 Reputation points
2020-07-27T01:53:07.933+00:00 You can modify this function to process the ratings any way you like. And to use your SQL SELECT to extract whatever KIND , GENRE, etc.
See attached13807-searchrating.txt