Reputation: 6954
Windows Search is built on Windows Index settings (shown below).
I need to make a powershell script (so everyone here can just run the script to get configured), to :
What would such a script look like?
Upvotes: 4
Views: 3685
Reputation: 148
It seems that File Types can be added and changed via the registry.
To add a new File Type and set it to "Properties and File Contents" using "Plain Text Filter", create a key at: Computer\HKEY_CLASSES_ROOT[.extensionYouWantToAdd]\PersistentHandler
Set the (Default) value to
Type: REG_RZ, Data: {5E941D80-BF96-11CD-B579-08002B30BFEB}
I'm not sure, but I'd venture a guess that the GUID specifies that the plain text filter should be used.
I imagine that it is also possible to change the indexed locations in a similar manner.
I figured this out by adding new file types manually and then searching the registry and to find the changes that were made. I have confirmed this works and also found this article that recommends the same technique: https://www.itprotoday.com/windows-78/how-can-i-include-specific-file-type-file-system-search-under-windows-xp
For my case I will be editing the registry via other methods, but it seems this is possible via Powershell also as outlined here: https://blog.netwrix.com/2018/09/11/how-to-get-edit-create-and-delete-registry-keys-with-powershell/
Once you have changed the registry, you will need to tell the index to rebuild. (Covered here: How to rebuild Windows Search Index by using PowerShell?)
Upvotes: 1