Search

about_function incorrect by PowerShellDon

Active

1
0
Sign in
to vote
Type: Bug
ID: 770663
Opened: 11/9/2012 4:11:44 PM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
From the doc about_functions:


     The following example is a function called Get-SmallFiles. This function
     has a $size parameter. The function displays all the files that are
     smaller than the value of the $size parameter, and it excludes
     directories:

         function Get-SmallFiles {
             param ($size)
             Get-ChildItem c:\ | where {$_.Length -lt $Size -and !$_.PSIsContainer}
         }


     In the function, you can use the $size variable, which is the name
     defined for the parameter.

     To use this function, type the following command:

         C:\PS> function Get-SmallFiles –Size 50


     You can also enter a value for a named parameter without the parameter
     name. For example, the following command gives the same result as a
     command that names the Size parameter:

         C:\PS> function Get-SmallFiles 50

Technically, you wouldn't use the keyword "function" when RUNNING the thing, right?
Details (expand)
How often does this happen?
Always Happens
Have you seen this problem before in this product?
Yes, this happens in all previous versions
Reproduction Steps
See http://technet.microsoft.com/en-us/library/hh847829.aspx
Expected Results
 

Where do you see this documentation issue.

TechNet Library
File Attachments
0 attachments
Sign in to post a comment.
Posted by Aleksandar Nikolić on 11/18/2012 at 3:53 PM
And the name should be Get-SmallFile. Singular.
Sign in to post a workaround.