German Translation / Deutsche Übersetzung
A powerful and user-friendly PowerShell wrapper for the Everything Search Engine (Version 1.5+). This module utilizes the Everything3_x64.dll from the Everything SDK to enable extremely fast file searches directly from the PowerShell console.
Tested with:
- PowerShell 7.5.2 and 7.6
- Everything 1.5.0.1423b-x64 (previously 1.5.0.1396a)
- SDK Version 3.0.0.9 (included
Everything3_x64.dll, signed by voidtools PTY LTD)- Website: https://www.voidtools.com/forum/viewtopic.php?t=15853
- Download: https://www.voidtools.com/Everything-SDK-3.0.0.9.zip
- Size: (503 KB - SHA256: 124685d35a5f49f3c1e9898853e166215748c893782c6a251f5dde58dacad4fa)
- GitHub: https://github.com/voidtools/everything_sdk3
- Fast Connection: Easy connection and disconnection from the Everything instance
- Powerful Search: Support for complex queries, regex, case sensitivity, and more
- Property Retrieval: Retrieve metadata such as size, creation date, and attributes
- Simple Handling: Convenient wrapper function
Find-Filesfor everyday searches - Connection Testing: Built-in function to test connection and display diagnostic information
- VSCode Compatibility: Automatic handling of VSCode-specific DLL loading issues
- PowerShell 7.0 or higher (the module uses PowerShell 7 syntax such as
??; Windows PowerShell 5.1 is not supported). PowerShell 7.5 or higher is recommended - Everything v1.5a or newer must be installed and running
- The
Everything3_x64.dll(from the official Everything SDK) must be located in the same directory as the module
-
Clone the repository:
git clone https://github.com/gitnol/PowerEverything3.git
-
Import the module into your PowerShell session:
Import-Module .\Everything3-PowerShell-Wrapper.psd1 -Verbose
-
Test the connection:
Test-EverythingConnection -
Find files:
Find-Files -Pattern "*.pdf" -MaxResults 10
| Function | Description |
|---|---|
Find-Files |
A simple wrapper function for quick file searches |
Search-Everything |
Performs detailed searches with all available options |
Connect-Everything |
Establishes a connection to the Everything client |
Disconnect-Everything |
Disconnects from the Everything client |
Test-EverythingConnection |
Verifies the connection to the Everything instance and displays status information |
Search for PDF and DOCX files:
Find-Files -Pattern "*" -Extensions @("pdf", "docx") -MaxResults 10Search for files with properties (size, date):
Find-Files -Pattern "invoice*" -IncludeProperties -MaxResults 5Regex search for image files with date pattern:
Find-Files -Pattern "regex:^\d{4}-\d{2}-\d{2}.*\.(jpg|png)$" -Verbose -MaxResults 10
# or
Find-Files -Pattern '^\d{4}-\d{2}-\d{2}.*\.(jpg|png)$' -Regex -Verbose -MaxResults 10Find the 5 largest files over 100 MB and sort by size:
# Manually establish connection
$client = Connect-Everything
# Execute search and sort by size in descending order
Search-Everything -Client $client -Query "size:>100mb" -MaxResults 5 -Properties "Size" -SortBy @{Property = "Size"; Descending = $true}
# Disconnect
Disconnect-Everything -Client $clientFind all files modified in the last 7 days:
$client = Connect-Everything
Search-Everything -Client $client -Query "dm:last7days" -MaxResults 10 -Properties "DateModified"
Disconnect-Everything -Client $clientFind empty files:
Find-Files -Pattern "size:0" -MaxResults 20-MaxResults 0 returns all results. The Exists property is only filled when -CheckExists is set – a Test-Path per result is expensive (Everything results come from the index and are usually current anyway).
$client = Connect-Everything
# all ZIP files larger than 100 MB below a folder, with size and modification date
$zips = Search-Everything -Client $client -Query 'file: ext:zip size:>100mb "D:\Data\"' -MaxResults 0 -Properties Size, DateModified
$zips | Select-Object FullPath, @{ n = 'SizeMB'; e = { [math]::Round($_.Properties['Size'] / 1MB) } }
# paging: results 101-200, sorted by name
Search-Everything -Client $client -Query 'ext:pdf' -Offset 100 -MaxResults 100 -SortBy @{ Property = 'Name' }
# verify that each result still exists on disk (slower)
Search-Everything -Client $client -Query 'ext:iso' -MaxResults 50 -CheckExists | Where-Object { -not $_.Exists }
Disconnect-Everything -Client $clientText properties (Name, Path, Extension, Type) are returned as full strings. Size is $null when Everything does not know it (e.g. folders).
Examples/Find-ArchivesWithExtractedFolder.ps1 is a complete file-server clean-up script built on this module. It finds archives (zip, 7z, rar, iso, tar.gz, …) for which a folder with the same name already exists in the same location – i.e. archives that were extracted and then kept.
- Searches via the Everything index in seconds; falls back to a parallel file-system scan if Everything is not available or a path is not indexed
-AllSharessearches all data shares of the server (skips system shares, DFS roots and nested shares)- Resolves the owners of the extracted folders via ADSI/LDAP (no ActiveDirectory module/RSAT needed)
- Writes a CSV and optionally sends one mail per owner; paths in mails are converted to
\\server\share\... - Owners that cannot be mailed (deleted/disabled accounts, no mail address, BUILTIN\Administrators) end up in one summary mail to the helpdesk
- Never deletes anything
cd .\Examples
Copy-Item .\Find-ArchivesWithExtractedFolder.config.example.ps1 .\Find-ArchivesWithExtractedFolder.config.ps1 # then adjust
# dry run on the whole server: CSV only
.\Find-ArchivesWithExtractedFolder.ps1 -AllShares -SearchMode Everything
# test: all mails go to $DebugTo, at most 3
.\Find-ArchivesWithExtractedFolder.ps1 -AllShares -SendMail -MaxMails 3
# production: mails to the owners
.\Find-ArchivesWithExtractedFolder.ps1 -AllShares -SearchMode Everything -SendMail -LiveRun it as administrator on the file server itself (needed for Get-Acl and Get-SmbShare). See the comment-based help (Get-Help .\Find-ArchivesWithExtractedFolder.ps1 -Full) for all parameters. Your real *.config.ps1, CSV and log files are excluded via .gitignore.
The module includes automatic workarounds for VSCode-specific issues when loading native DLLs:
- Automatic DLL Loading: The
Everything3_x64.dllis explicitly loaded viaKernel32::LoadLibrary() - PATH Handling: The module directory is automatically added to the PATH
- Error Handling: Robust handling of VSCode-specific parameter binding issues
These measures ensure that the module functions correctly in both the regular PowerShell console and VSCode.
SDK 3.0.0.9, fixes and archive example
- Updated
Everything3_x64.dllto SDK 3.0.0.9 (more robust pipe connection when Everything is busy, crash and memory-corruption fixes in the SDK – see the SDK changelog) - Fixed: P/Invoke signatures used
uintforSIZE_Tparameters/return values (index, count, buffer size) – nowUIntPtr(64-bit on x64), as declared inEverything3.h - Fixed: text properties (
Name,Path,Extension,Type) only returned their first character (Everything3_GetResultPropertyTextWwas declared withoutCharSet.Unicode) - Fixed: the property
Nameand sorting byNamewere silently ignored (property ID0was treated as "unknown") - Fixed:
$error(automatic variable) was overwritten in error handling - New:
-MaxResults 0returns all results;-Offsetfor paging is passed correctly - New:
-CheckExists–Existsis only checked on request ($nullotherwise). Behaviour change: previouslyTest-Pathran for every result - Faster: results are collected in a list instead of
+=(5,000 results: 6.3 s → 0.5 s) Sizeis$nullinstead of18446744073709551615when unknown (e.g. folders)- Loading the module no longer writes to the console (messages moved to
-Verbose) - New example:
Examples/Find-ArchivesWithExtractedFolder.ps1 - Requirements corrected: PowerShell 7.0+
This project is provided without any warranty. Use at your own risk.
This project is not affiliated with VoidTools. All trademarks belong to their respective owners. This is a pure research and development project.