# encoding: ascii
# api: powershell
# title: Select-TextOutput.ps1
# description: From Windows PowerShell Cookbook (O’Reilly) by Lee Holmes
# version: 0.1
# author: Lee Holmes
# license: CC0
# x-poshcode-id: 2215
# x-archived: 2016-03-18T22:01:07
# x-published: 2011-09-09T21:42:00
#
#
##############################################################################
##
## Select-TextOutput
##
## From Windows PowerShell Cookbook (O'Reilly)
## by Lee Holmes (http://www.leeholmes.com/guide)
##
##############################################################################
<#
.SYNOPSIS
Searches the textual output of a command for a pattern.
.EXAMPLE
Get-Service | Select-TextOutput audio
Finds all references to "Audio" in the output of Get-Service
#>
param(
## The pattern to search for
$Pattern
)
Set-StrictMode -Version Latest
$input | Out-String -Stream | Select-String $pattern