Skip to content

Instantly share code, notes, and snippets.

@stuartleeks
Created July 2, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuartleeks/aaa4a55ebe4df55166cc to your computer and use it in GitHub Desktop.
Save stuartleeks/aaa4a55ebe4df55166cc to your computer and use it in GitHub Desktop.
Find-InPath.ps1 - simple PowerShell Script to find files in the PATH
[CmdletBinding()]
param (
[string] $filename
)
$matches = $env:Path.Split(';') | %{ join-path $_ $filename} | ?{ test-path $_ }
if ($matches.Length -eq 0){
"No matches found"
} else {
$matches
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment