I have a function that takes one string parameter, and one array of string parameter
Function w
{
param([string]$format, [string[]]$args)
Write-Host $format
Write-Host $args
}
Then I execute the function in the following way:
w "formatParam" "args1" "args2"
w "formatParam" "args1" "args2" "args3"
w "formatParam" "args1" "args2" "args3" "args4"
w "formatParam" "args1" "args2" "args3" "args4" "args5"
As can be seen in the output, the string array does not seem to load the first parameter, that is meant to go into the array:
formatParam
args2
formatParam
args2 args3
formatParam
args2 args3 args4
formatParam
args2 args3 args4 args5
Any ideas?