title: How to edit a query on TFS (website) with Powershell?
body: <p>I'm trying to automate some processes with Powershell.  One of which, whenever we do branching, we have to manually udpate the "Current Release" query on our TFS site that searches User stories, so it has the right Release version in the search parameters.  Example screenshots below.</p>
  
  <p><a href="https://i.stack.imgur.com/y6R98.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y6R98.png" alt="enter image description here"></a></p>
  
  <p>This is where I would go on TFS to access the query and then edit it.  Below is the editor screen, and I would replace the date fields in there with the date of the new release version.  What I want is to access these fields via powershell (as some sort of TFS object, I would think) and update them.</p>
  
  <p><a href="https://i.stack.imgur.com/jwkQQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jwkQQ.png" alt="enter image description here"></a></p>
  
  <p>I've been messing around with the TFS Power Tools for Powershell, as well as some of the object stuff when I get the server <code>$server = New-Object Microsoft.TeamFoundation.Client.TeamFoundationServer($tfsURI)</code>.  But through google-fu and just messing with it, I can't figure out how to edit the query from Powershell.  Can anyone help?</p>