Test Scripts

suggest change

The ISE, included with Windows PowerShell 3.0 through 5.1, can run the selected text in the editor with F8.

$input is the automatic pipeline enumerator. Do not name a parameter $input. The call sits outside the function. The sum of 1 through 10 is 55.

function Get-Sum {
    foreach ($i in $input) {
        $Sum += $i
    }
    $Sum
}

1..10 | Get-Sum
55

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents