title: How to use GET method of Invoke-WebRequest to build a query string
body: <p>Is there a standard way to make use of Invoke-WebRequest or Invoke-RestMethod in PowerShell to get information from a web page using a query string?</p>
  
  <p>For example, I know that the following when used with a well formed JSON end point will work:</p>
  
  <pre><code>$Parameters = @{
    Name = 'John'
    Children = 'Abe','Karen','Jo'
  }
  $Result = Invoke-WebRequest -Uri 'http://.....whatever' -Body ( $Parameters | ConvertTo-Json)  -ContentType application/json -Method Get
  </code></pre>
  
  <p>along with the equivalent Invoke-WebMethod.  An important aspect of this is the content type and ConvertTo-JSON which manages the transformation of the parameters specified in the -Body part in to a standard form, including the array aspect of the "Children" field.</p>
  
  <p>What is an equivalent way to do this with a website which uses, say, a comma delimited convention for managing array arguments in the URL or an approach such as "Children[]=Abe&amp;Children[]=Karen&amp;Children=Jo"?</p>
  
  <p>Is there a content type that I'm missing and is there an equivalent ConvertTo-?? that I can use?  My guess is that someone has had to do this before.</p>
  
  <p>For context this is an often used 
   way of encoding an array parameter in the URL and is commonly seen in PHP web sites. </p>
  
  <p><a href="https://stackoverflow.com/questions/1763508/passing-arrays-as-url-parameter">passing arrays as url parameter</a></p>
  
  <p><strong>Edit</strong>
  Removed references to PHP except for specific context and adjusted the title to refer to a query string. The problem is about encoding a query string not PHP per se.</p>