PoshCode Archive  Artifact Content

Artifact 29bd6051b440c0118856743605002910f3b24bd7a7eb28c139ba4e012159e7f0:

  • File Where-like.ps1 — part of check-in [02558a9c7e] at 2018-06-10 13:39:01 on branch trunk — Where-like function works as a pipeline console filter. (user: sibroller size: 564)

# encoding: ascii
# api: powershell
# title: Where-like
# description: Where-like function works as a pipeline console filter.
# version: 0.1
# type: function
# author: sibroller
# license: CC0
# function: Where-Like
# x-poshcode-id: 4283
# x-archived: 2013-07-09T04:19:50
# x-published: 2013-07-02T08:00:00
#
# The idea is to filter a result of any cmdlet with less effort.
# I.g. Get-ChildItem ‘C:\Windows’ | Where-Like name explo
#
function Where-Like {
	Param($member, $string)
	process { $input | where {$_.$member -like $string} } 
}