You do not call functions like this. You are basically sending all the arguments as the first parameter. You call them like this
# test function
function Get-Something {
Param(
[parameter(ValueFromPipelineByPropertyName)]
$FirstParam,
[parameter(ValueFromPipelineByPropertyName)]
$SecondParam
)
process{
Write-Host FirstParam: $FirstParam SecondParam: $SecondParam
}
}
preferred to be verbose
# named parameters
Get-Something -firstparam firstarg - secondparam secondarg
next option is positional parameters
# positional parameters
Get-Something firstarg secondarg
Finally the pipeline
# pipeline
[PSCustomObject]@{FirstParam = 'firstarg';SecondParam = 'secondarg'} | Get-Something
All of these output
FirstParam: firstarg SecondParam: secondarg
Now watch when we call it incorrectly with parenthesis
Get-Something ('firstarg', 'secondarg')
FirstParam: firstarg secondarg SecondParam:
Uh oh, both arguments went as the first parameter.