title: No characters are allowed after a here-string header but before the end of the line
body: <p>I am using this a a basis for my script:</p>
  
  <p><a href="https://www.nwcadence.com/blog/vststfs-rest-api-the-basics-and-working-with-builds-and-releases" rel="noreferrer">https://www.nwcadence.com/blog/vststfs-rest-api-the-basics-and-working-with-builds-and-releases</a></p>
  
  <p>And my script is as follows</p>
  
  <pre><code>Param(
     [string]$vstsAccount = "abc",
     [string]$projectName = "abc",
     [string]$user = "",
     [string]$token = "xyz"
  )
  
  # Base64-encodes the Personal Access Token (PAT) appropriately
  $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user,$token)))
  
  $verb = "POST"
  
  
  $body = @"{
  
      "definition": {
           "id": 20
      }
  }"@
  
  
  $uri = "https://$($vstsAccount).visualstudio.com/DefaultCollection/$($projectName)/_apis/build/builds?api-version=4.1"
  $result = Invoke-RestMethod -Uri $uri -Method $verb -ContentType "application/json" -Body (ConvertTo-Json $body)  -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)}
  </code></pre>
  
  <p>But I have syntax errors on the body definition which I used from the blog post above.</p>
  
  <pre><code>&gt; o characters are allowed after a here-string header but before the end
  &gt; of the line. At C:\Users\abc\Documents\vstsqueuebuild.ps1:18 char:17
  &gt; +     "definition": {
  &gt; +                 ~ Unexpected token ':' in expression or statement. At C:\Users\abc\Documents\vstsqueuebuild.ps1:19 char:14
  &gt; +          "id": 20
  &gt; +              ~ Unexpected token ':' in expression or statement. At C:\Users\anc\Documents\vstsqueuebuild.ps1:21 char:1
  &gt; + }"@
  &gt; + ~ Unexpected token '}' in expression or statement. At C:\Users\abc\Documents\vstsqueuebuild.ps1:24 char:9
  &gt; + $uri = "https://$($vstsAccount).visualstudio.com/DefaultCollection/$( ..
  </code></pre>