Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 151837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:30:58+00:00 2026-05-11T09:30:58+00:00

We are using TFSDeployer to listen to build quality changes and deploy to our

  • 0

We are using TFSDeployer to listen to build quality changes and deploy to our staging environment when it transitions to ‘Staging’.

I’d like to have it go ahead and update all of the other builds that have a currently build quality of ‘Staging’ to be ‘Rejected’.

This appears to be something that needs to happen inside the PowerShell script which looks like:

$droplocation = $TfsDeployerBuildData.DropLocation ECHO $droplocation  $websourcepath = $droplocation + '\Release\_PublishedWebsites\CS.Public.WebApplication\' $webdestinationpath = '\\vmwebstg\WebRoot\CreditSolutions\'  new-item -force -path $webdestinationpath -itemtype 'directory' get-childitem $webdestinationpath | remove-item -force -recurse get-childitem $websourcepath | copy-item -force -recurse -destination $webdestinationpath  $configFile = $webdestinationpath + 'web.development.config' remove-item $configFile -force  $configFile = $webdestinationpath + 'web.staging.config' $configFileDest = $webdestinationpath + 'web.config' move-item $configFile $configFileDest -force 

So, how can I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T09:30:59+00:00Added an answer on May 11, 2026 at 9:30 am

    First add the Get-tfs function to your script:

    function get-tfs (     [string] $serverName = $(Throw 'serverName is required') ) {     # load the required dll     [void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.TeamFoundation.Client')      $propertiesToAdd = (         ('VCS', 'Microsoft.TeamFoundation.VersionControl.Client', 'Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer'),         ('WIT', 'Microsoft.TeamFoundation.WorkItemTracking.Client', 'Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore'),         ('BS', 'Microsoft.TeamFoundation.Build.Common', 'Microsoft.TeamFoundation.Build.Proxy.BuildStore'),         ('CSS', 'Microsoft.TeamFoundation', 'Microsoft.TeamFoundation.Server.ICommonStructureService'),         ('GSS', 'Microsoft.TeamFoundation', 'Microsoft.TeamFoundation.Server.IGroupSecurityService')     )      # fetch the TFS instance, but add some useful properties to make life easier     # Make sure to 'promote' it to a psobject now to make later modification easier     [psobject] $tfs = [Microsoft.TeamFoundation.Client.TeamFoundationServerFactory]::GetServer($serverName)     foreach ($entry in $propertiesToAdd) {         $scriptBlock = '             [System.Reflection.Assembly]::LoadWithPartialName('{0}') > $null             $this.GetService([{1}])         ' -f $entry[1],$entry[2]         $tfs | add-member scriptproperty $entry[0] $ExecutionContext.InvokeCommand.NewScriptBlock($scriptBlock)     }     return $tfs } 

    Next, instantiate the TFS object

    $tfs = get-tfs http://YourTfsServer:8080 

    Then find the builds with a build quality of ‘Staging’

    $builds = $tfs.BS.GetListOfBuilds('Test Project', 'TestBuild') |  where {$_.BuildQuality -eq 'Staging'} 

    Finally, update the quality of these builds

     foreach ($build in $builds) { $tfs.BS.UpdateBuildQuality($build.BuildUri, 'Rejected') } 

    (I haven’t run this script yet, but you should be able to get it going without troubles)

    More info on my blog: Using the Team Foundation Object Model with PowerShell

    One last advice, if you update the Build quality from within the script that is running from TfsDeployer, you could end up with 2 script running at the same time if you have a mapping for the Staging –> Rejected transition!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 91k
  • Answers 91k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You may need to move that definition into CPPFLAGS or… May 11, 2026 at 6:14 pm
  • Editorial Team
    Editorial Team added an answer Try ObservableCollection<DirectoryInfo> instead - you're triggering a refresh of the… May 11, 2026 at 6:14 pm
  • Editorial Team
    Editorial Team added an answer You could always recommend that your user just hits Ctrl+K,… May 11, 2026 at 6:14 pm

Related Questions

We are using a Sony SNC-RZ30N IP-based webcam to monitor osprey nests and would
We are using PowerDesigner at work for database modelling. But there is a hell
We are using SQL 2005 and the try-catch functionality to handle all of our
We are using fmt:setBundle to load a resource bundle from a database (we extended

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.