Function parameters

I have created a function that has a parameter ComputerName. I use ValueFromPipline=$true, and everything works OK. So I can use the function with a single value or a series of values from the pipeline.
How can I also use a list of values, similar to most CmdLets that have a ComputerName parameter.
I what the function to accept a single value, a list of values or accept values from the pipeline.
I just can’t workout the list of values part.


This is the usual setup for parameters that fit your description:

function Test-Something
    param (
        [string[]] $ComputerName = '.'

        foreach ($computer in $ComputerName)
            "Processing $computer"

By declaring the parameter as an array (in this case, [string]), callers can then use any of these conventions:

Test-Something -ComputerName 'Single'
Test-Something -ComputerName 'Multiple 1', 'Multiple 2'
'Multiple 1', 'Multiple 2' | Test-Something

Brilliant! Thank You.