Created
May 26, 2021 01:52
-
-
Save aleybe/f51219cc0f8143b5637f0c2700c3b790 to your computer and use it in GitHub Desktop.
This file contains 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
function Get-LsGrep { | |
[Alias("lgrep")] | |
[CmdletBinding()] | |
param ( | |
[Parameter(ValueFromPipeline)] | |
[System.Array] | |
$lsOutput, | |
# Parameter help description | |
[Parameter(Position=1)] | |
[System.String] | |
$greppable | |
) | |
begin { | |
[System.Collections.ArrayList]$dataArray = @() | |
} | |
process { | |
$dataArray.Add($lsOutput) >> $null | |
} | |
end { | |
$stringResult = ($dataArray | Out-String) | |
return $stringResult | %{$_.Split([System.Environment]::NewLine)} | sls $greppable | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment