Skip to content

Fast, cross-platform PowerShell module to find files & folders, grep file content, and measure sizes—Linux-style find/grep/du made simple.

License

Notifications You must be signed in to change notification settings

eizedev/PSItems

PSItems — fast filesystem search & content scanning for PowerShell

GitHub Actions PS Gallery (downloads + version) License Issues / PRs
GitHub Actions Status PowerShell Gallery PS Gallery Version License Open Issues Open PRs
Runtime (pwsh) Platforms Quality & Maintenance
pwsh 7+ Platforms PSSA DevSkim Dependabot

Logo


A Linux-style toolkit for PowerShell that’s fast by default. It streams from .NET System.IO.Enumerate* to keep memory low and throughput high.

Features at a glance

  • Cross-platform: Windows • Linux • macOS (PowerShell 7+).
  • Commands: psfind (find files/dirs), psgrep (search content), pssize (measure sizes).
  • Linux-like UX: switches such as -Iname, -Type, -Depth, -MinDepth. -Path wildcards expand to multiple roots.
  • Fast: streaming enumeration with minimal allocations.

Installation

Install-Module -Name PSItems -Scope CurrentUser
Import-Module -Name PSItems

Aliases at a glance

Aliases Underlying cmdlet Linux/Unix analog Description
psfind, search, ff, fi Find-Item find Find items (files/directories/etc.)
psgrep Find-ItemContent grep Search for text/regex in files
pssize, size Get-ItemSize du Measure size of files/directories

Quick start

# Find: list everything one level down as fast strings
psfind $HOME -Name '*' -Depth 1

# Find: case-insensitive *.log anywhere
psfind $HOME -Type File -Iname '*.log' -Recurse

# Size: quick size of your home (one level down), in MB (default)
pssize $HOME -Depth 1

# Grep: find 'TODO' in all PowerShell scripts under your home (recursive)
psgrep 'TODO' $HOME -Name '*.ps1' -Recurse

Complete docs for each cmdlet live in docs/en-US/ and via Get-Help <CmdletName> -Full.


Linux find ↔︎ Find-Item (quick map)

Full guide with more options & examples: res/guides/Linux-find-compatibility.md

Linux find feature Find-Item equivalent Example (unescape | when copying)
Wildcard roots (/var/*/log) -Path expands to multiple roots psfind -Path '/var/*/log' -Name '*.log' -Recurse
Root / /C:\ on Windows psfind / -Name '*' -Recurse
-name PATTERN -Name (platform default casing) psfind / -Name '*.log' -Recurse
-iname PATTERN -Iname (always case-insensitive) psfind / -Iname '*.exe' -Recurse
-type f / -type d -Type File / -Type Directory psfind / -Type File -Name '*.txt' -Recurse
-maxdepth N / -mindepth N -Depth N / -MinDepth N psfind / -Depth 2 -Name '*.dll'
-ls -As FileSystemInfo psfind / -As FileSystemInfo -Recurse
-exec … {} Pipe to PowerShell psfind $HOME -Type File -Iname '*.txt' -Recurse | ForEach-Object { Get-Item $_ }

Notes: Use -Iname for portable case-insensitive matching; -Path wildcards expand to multiple roots; filter size/time/perm in the pipeline.


Testing & Speed

Reproducible, copy‑pasteable benchmarks live here:

Highlights from a sample run (Windows, SSD):

  • Names only (strings): PSItems ~3.23 s vs Get-ChildItem ~17.16 s~5.3× faster
  • Typed output (objects): PSItems ~3.56 s vs Get-ChildItem ~14.19 s~4.0× faster
  • Depth-limited (Depth = 2): PSItems ~2.14 s vs Get-ChildItem ~11.96 s~5.6× faster
  • PSItems 0.7.0 vs 0.3.6 (names-only): ~3.37 s vs ~5.70 s~1.7× faster

Numbers vary by machine and dataset. The linked doc shows the exact commands you can re-run locally.


Contributing

PRs that improve performance, reliability, cross‑platform behavior, or docs are welcome.

Publishing to the PowerShell Gallery is automated via GitHub Actions; tags like v0.7.0 trigger a release.


Sponsor this project

 

Contributors 4

  •  
  •  
  •  
  •