title: Repeatable Parameters in Powershell Function (Preferably Linked Parameter Sets)
body: <p>I am wondering if it is possible (and if so how) to create repeatable (and hopefully linked) parameters in a PowerShell function.  This is how am looking for this to work:</p>
  
  <pre><code>function foo()
  {
      [CmdletBinding()]
      Params(
          [Parameter(Mandatory=$true,ParameterSetName="Default")]
          [Parameter(Mandatory=$true,ParameterSetName="Set1")]
          [Parameter(Mandatory=$true,ParameterSetName="Set2")]
           [string]$SomeParam1,
          [Parameter(Mandatory=$true,ParameterSetName="Set1")]
          [Parameter(Mandatory=$true,ParameterSetName="Set2")]
          *some magic here, likely, to make this repeatable*
           [string]$SomeRepeatableParam,
          [Parameter(Mandatory=$true,ParameterSetName="Set1")]
           [string]$SomeLinkedParam1,
          [Parameter(Mandatory=$true,ParameterSetName="Set2")]
           [string]$SomeLinkedParam2
      )
      Begin
      {
          *some code here*
      }
      Process
      {
          foreach ($val in $SomeRepeateableParam)
          {
              *some code here using param and its linked param*
          }
      }
      End
      {
          *some code here*
      }
  }
  </code></pre>
  
  <p>And then call this function like so:</p>
  
  <pre><code>foo -SomeParam "MyParam" -SomeRepeatableParam "MyProperty1" -SomeLinkedParam1 "Tall" -SomeRepeatableParam "MyProperty2" -SomeLinkedParam2 "Wide"
  </code></pre>
  
  <p>and so on, being able to use the repeatable parameter as many times in a single call as I feel like it.</p>
  
  <p>Can this be done?  And if so how?</p>
  
  <p>Thanks for your time.</p>
  
  <p>EDIT: For clarity, I don't mean an array parameter, but a repeatable parameter in which the linked parameter sets can be matched to each instance of the repeatable parameter.</p>