PoshCode Archive  Artifact Content

Artifact 5ca0a1e7bd34d44beaeb09140d269ceb1e5a5d44d939a7c177c8bb1f742fef9d:

  • File Where-Like.ps1 — part of check-in [37abeb7d04] at 2018-06-10 13:38:52 on branch trunk — Where-like function works as a pipeline console filter. (user: unknown size: 497)

# encoding: ascii
# api: powershell
# title: 
# description: Where-like function works as a pipeline console filter.
# version: 0.1
# type: function
# license: CC0
# function: Where-Like
# x-poshcode-id: 4275
# x-archived: 2013-07-01T01:42:46
#
# 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} } 
}