title: Accept a variable number of hashsets as arguments
body: <p>I am trying to write a powershell script that takes a string as a first argument and then a variable number of dictionaries.</p>
  
  <p>This is how the script starts:</p>
  
  <pre><code>param
  (
      [Parameter(Mandatory = $true)]
      [ValidateNotNullOrEmpty()]
      [string] $Identity,
  
      [Parameter(Mandatory = $true,
          ValueFromRemainingArguments=$true,
          Position = 1)]
      [ValidateNotNullOrEmpty()]
      [hashtable[]] $Contacts
  )
  </code></pre>
  
  <p>When I try to execute the script as below:</p>
  
  <blockquote>
    <p>.\scriptName.ps1 "alice@alice"  @{email="a"; firstName="fn"} @{email="b";firstName="fn2"}</p>
  </blockquote>
  
  <p>I get the following errors:</p>
  
  <blockquote>
    <p>D:\Griffin\sources\dev\SubstrateSearch\src\TdsDeployment\SetupSubstrateSearchServices\Scripts\CreateExplicitContacts.ps1
    : Cannot process argument transformation on parameter 'Contacts'.
    Cannot convert value
    "System.Collections.Generic.List`1[System.Object]" to type
    "System.Collections.Hashtable[]". Error: "Cannot convert the
    "alice@alice" value of type "System.String" to type
    "System.Collections.Hashtable"." At line:1 char:1
    + .\CreateExplicitContacts.ps1 "alice@alice"  @{email="a"; firstName="f ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidData: (:) [CreateExplicitContacts.ps1],
    ParameterBindingArgumentTransformationException
        + FullyQualifiedErrorId : ParameterArgumentTransformationError,CreateExplicitContacts.ps1</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>