Created
July 18, 2017 11:00
-
-
Save starlightsys/1962e083188d1dd84e27762a174c67e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$True)] | |
[string]$grep_pattern, | |
[Parameter(Mandatory=$True)] | |
[string]$glob_pattern, | |
[Parameter(Mandatory=$False)] | |
[string]$path | |
) | |
If (Test-Path variable:local:path) { | |
$files = Get-ChildItem -Path $path -Include $glob_pattern -Recurse | |
} else { | |
$files = Get-ChildItem -Include $glob_pattern -Recurse | |
} | |
$files | Select-String $grep_pattern -CaseSensitive |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment