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 } }