My specific use case - Thunderbird allows for emails to be stored in "maildir" format, i.e. individual files for each email with an .eml extension. But to be used in Thunderbird, the .eml files must be located in folders in the Thunderbird profile folder. The names that Thunderbird gives to these .eml files are not very meaningful to me. So my idea is to make hard links to these .eml files, rename the the hardlink files to be more meaningful to me, and move them to other locations on the same volume. My idea is to use Everything to identify the .eml files that don't have hard links to them yet, and then create them.
I know I can use the Everything GUI to display a "Hard Link Count" column, and this would show .emls with a Hard Link Count of 1 (the original directory entry). However, to automate things, I'd like to use es.exe to generate a collection of files with hardlinkcount=1 and feed that in Powershell pipeline for further processing.
Is there a way to use es.exe to do this? It seems not yet - from a recent post by Void it seems that es.exe support for search by property values is on the todo list.
Meanwhile it does seem that pseverything might work for my purpose - i can generate a list of files with a command as follows:
search-everything *.eml -filter hard-link-count:=1
I'm hoping that it produces not just text output, but a collection of fileinfo objects with their associated properties and methods to facilitate processing in Powershell.
It would be great if es.exe output could also be in the form of objects.
es.exe filter on "hard link count" or other properties?
Re: es.exe filter on "hard link count" or other properties?
Not yet, sorry.
Property support for es is on my TODO list.
I will look into an option to output as a powershell object.
Thank you for the suggestions.
Property support for es is on my TODO list.
I will look into an option to output as a powershell object.
Thank you for the suggestions.
Re: es.exe filter on "hard link count" or other properties?
I also use the MailDir format since many years.
To quickly find mails, I let Everything index the content of the Thunderbird eml files.
To quickly find mails, I let Everything index the content of the Thunderbird eml files.
Re: es.exe filter on "hard link count" or other properties?
You should be able to use ES.exe for properties too. The limitation is in the output: showing the value of various Property columns, like the actual hardlink count number.
You can still search for properties (input).
So this will work in PowerShell (example):
Code: Select all
PS T:\> es.exe ext:exe everything.exe hardlinkcount:2
C:\Program Files\Everything 1.5a\Everything.exe
PS T:\>
To convert textual filenames to objects:
Code: Select all
es.exe ext:exe everything.exe hardlinkcount:2 | Get-Item
Converting text to PowerShell objects is not something Everything should take care of as it is quite complex (in my opinion).
Re: es.exe filter on "hard link count" or other properties?
Thanks Notnull, that's very helpful. On the subject of getting objects to put into the Powershell pipeline, I remembered I had seen a video about a new way to do that. I found it and it's called Crescendo ( https://github.com/PowerShell/Crescendo ):
Crescendo is a development accelerator enabling you to rapidly build PowerShell cmdlets that leverage existing command-line tools. Crescendo amplifies the command-line experience of the original tool to include object output for the PowerShell pipeline, privilege elevation, and integrated help information. A Crescendo module replaces cumbersome command-line tools with PowerShell cmdlets that are easier to use in automation and packaged to share with team members.
Re: es.exe filter on "hard link count" or other properties?
Interesting, thank you1
Regarding the complexity of converting to file objects:
Everything/ ES can report files that are currently unavailable (on removable disks, for example); it wouyld be complex to convert these non-existing files -- from the viewpoint of the operating system -- to a file object. Might even be impossible.