For some reason, it looks like I cannot pass array of strings as parameter to scriptblock. What am I doing here wrong?
My script which is called from another script:
param(
[parameter(Mandatory=$true)]
[string[]]$myarr
)
foreach ($elem in $myarr){
$elem
}
I call it from another script as
$myarr = @("111", "222")
start-job -filepath myscript.ps1 -arg $myarr
I got only the first item in the array - "111".