Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - about_function doc error

Reply
 
Old 12-04-2006   #1 (permalink)
William Stacey [C# MVP]


 
 

about_function doc error

The help about_function doc seems mixed up:

"...You can also define parameters in filters. For example, to create a
filter
that returns a list of processes with a certain initial letter, use
a format such as the following:

filter process_1
{
param([string]$first)
$_.processname -like "$first*"
}

When you call the filter, you must specify the first letter as an
argument, as shown in the following example:
Get-Process | where { process_1 c } ..."

This seems to have a few issues. 1) the filter returns bool, not an object
and 2) "where { filter }" is not correct.
I think the intention was this:

filter process_1
{
param([string]$first)
if ($_.processname -like "$first*") {$_}
}

PS c:\> process | process_1 win

--
William Stacey [C# MVP]




My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Help with windows vista mail, Socket Error: 10053, Error Number: 0x800CCC0F Vista mail
no,socket Error: 11003. Error Number: 0x800CC0D cant i send email name is correctly Vista mail
Canot post to newsgroups Socket Error: 10053, Error Number: 0x800CCC0F Vista mail
Canot post to newsgroups Socket Error: 10053, Error Number: 0x800CCC0F Vista General
windows live mail 2008 (Build 12.0.1606) error report error Windows Live


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46