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