title: Set tfs build variables via powerShell
body: <p>To queue a build i use this ps script</p>
  
  <pre><code> param (
      [string]$definitionName = "",
      [string]$testFilter = ""
   )
  $rootTfsUri = "rootUri"
  $collectionName = "CollectionName"
  $projectName = "ProjName"
  $tfsUri = $rootTfsUri + "/" + $collectionName + "/" + $projectName
  $buildDefinition = "WebTesting-Regress-" + $definitionName
  $buildDefinitionUri = "$tfsUri/_apis/build/definitions?api-version=3.1&amp;name=$buildDefinition" 
  
  # first get build definition id
  $buildResponse = Invoke-WebRequest -Uri $buildDefinitionUri -UseDefaultCredentials -Method Get -Verbose -UseBasicParsing -ContentType "application/json" 
  $buildResponseAsJson = $buildResponse.Content | convertfrom-json
  $buildDefinitionId = $buildResponseAsJson.value.id
  
  
  # Now queue this build definition
  $requestContentString = @"
  {
      "definition": {
          "id" : "$buildDefinitionId"
      },
      "variables": {
          "testFilter": {
            "value": "$testFilter"
  
          }
      }
  }
  "@
  
  $buildUri = "$tfsUri/_apis/build/builds?api-version=3.1"
  $buildResponse = Invoke-WebRequest -Uri $buildUri -UseDefaultCredentials -Method Post -Verbose -UseBasicParsing -ContentType "application/json" -Body $requestContentString
  $buildNumber = ($buildResponse.Content | ConvertFrom-Json).buildNumber
  </code></pre>
  
  <p>it works good but i need to change build variable before my test started, how can i do this? 
  i've tried to send it with id in body but it didn't works</p>
  
  <p><a href="https://i.stack.imgur.com/E5Doa.png" rel="nofollow noreferrer">VariablesExample</a></p>