title: POSTing Form Fields with Same Name in Powershell
body: <p>I am looking to emulate a POST request using Powershell (v4). Fiddler has enabled me to replicate the original in all relevant aspects other than the following:</p>
  
  <p><a href="https://i.stack.imgur.com/LdDPQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LdDPQ.png" alt="example of multiple form fields with same name"></a></p>
  
  <p>I have tried a number of approaches, the easiest to explain / demonstate is probably:</p>
  
  <pre><code>invoke-webrequest -Uri "$uri"  `
    -body @{
      _program='/Web/storm'
      SASControlTable='[{"Name":"COL1","Type":"str"},{"Name":"COL2","Type":"str"}]'
      SASControlTable='[{"COL1":"VAL1","COL2","VAL2"}]'
    } -method post  -usedefaultcredentials
  </code></pre>
  
  <p>This gives the error:</p>
  
  <blockquote>
    <p>Duplicate keys 'SASControlTable' are not allowed in hash literals.</p>
  </blockquote>
  
  <p>How do I submit multiple fields with the same name using Powershell?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>My actual http body looks like this:</p>
  
  <pre><code>_program=%2FWeb%2Fstorm&amp;_debug=0&amp;_service=default&amp;SASControlTable=%5B%7B%22colName%22%3A%22ACTION%22%2C%22colType%22%3A%22string%22%2C%22colLength%22%3A14%7D%5D&amp;SASControlTable=%5B%7B%22ACTION%22%3A%22INITIALISATION%22%7D%5D
  </code></pre>
  
  <p>Submitting an identical body with Powershell does not give me two parameters for  <code>SASControlTable</code> in the WebForms tab of fiddler (and only the second parameter is received by the web server).  This is the issue I am trying to solve..</p>