title: Pass 1 or multiple arrays via one parameter to function
body: <p>I experience different behaviour if I pass 1 or multiple arrays via one parameter to a function:</p>
  
  <p>Function call:</p>
  
  <pre><code>#Case #1: 2 array's
  $rankarray1 = @('subtest1','subtest2')
  $rankarray2 = @('subtest3','subtest4')
  $viz += Add-swcVizSubGraph […]-Rank $rankarray1,$rankarray2 […]
  
  #Case #2: 1 array
  $rankarray3 = @('test1','end')
  $viz = Add-swcVizBody […] -rank $rankarray3
  </code></pre>
  
  <p>Snippet of function <code>Add-swcVizSubGraph</code>/<code>Add-swcVizBody</code>:</p>
  
  <pre><code>$p_rank = $null
  foreach ($rankrequest in $rank) {
      $RankOnLine = $rankgrequest -join " "
      $p_rank += "{rank=same $($RankOnLine )} `n"
  }
  </code></pre>
  
  <p>For Case#1 I get as expected both arrays, which I can access individually by index:</p>
  
  <pre>
  $rank[0]
  Output:
  subtest1
  subtest2
  
  $rank[1]
  Output:
  subtest3
  subtest4
  </pre>
  
  <p>For Case#2 however, the passed array is treated just as one array (which I can actually understand):</p>
  
  <pre>
  $rank
  Output:
  test1
  end
  </pre>
  
  <p><strong>Question:</strong> Is there a best practice how to pass 1 or n arrays and treat it the same way in the function?</p>