For some reason, it seems like I cannot pass an array of strings as a parameter to a script block. What am I doing wrong here?
My script that is being 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 element in the array - "111".
arrays parameters powershell arguments
mishkin Aug 22 '11 at 19:45 2011-08-22 19:45
source share