Skip to content

Searchquery with Extensions on 1.5a #1

@andbrai

Description

@andbrai

Query with Brackets (eg. * (ext:txt|ext:doc)) did not work for me!

Changed to get proper Output for:
Find-Files -Pattern "*" -Extensions @("pdf", "docx")

diff --git a/Everything3-PowerShell-Wrapper.psm1 b/Everything3-PowerShell-Wrapper.psm1
index 989d887..e820300 100644
--- a/Everything3-PowerShell-Wrapper.psm1
+++ b/Everything3-PowerShell-Wrapper.psm1
@@ -302,8 +302,8 @@ function Find-Files {
         # Query mit Erweiterungen erstellen
         $query = $Pattern
         if ($Extensions.Count -gt 0) {
-            $extQuery = ($Extensions | ForEach-Object { "ext:$_" }) -join "|"
-            $query = "$Pattern ($extQuery)"
+            $extQuery = $Extensions -replace "\." -join "|"
+            $query = "$Pattern ext:$($extQuery)"
         }
         
         # Eigenschaften festlegen

Now also works:
Find-Files -Pattern "*" -Extensions @(".pdf", ".docx")

Very nice helpfull Wrapper. THX for it!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions