Jump to content

How to get updated files from tfs


SonaParv_522

Recommended Posts

12 minutes ago, karna11 said:

Right click da solution, thrn click da get latest option   u 'll get all latext files in to u t locsl

Manual ga kaadu. Powershell scripts use chesi cheyyali

Link to comment
Share on other sites

# The deploy directory for all the msi, zip etc.
$AutoDeployDir = "Your TFS Directory Server Path"
$deployDirectory = $($Env:TF_BUILD_DROPLOCATION + "\Deploy\" + $Env:TF_BUILD_BUILDNUMBER)

# Add TFS 2013 dlls so we can download some files
Add-Type -AssemblyName 'Microsoft.TeamFoundation.Client, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Add-Type -AssemblyName 'Microsoft.TeamFoundation.VersionControl.Client, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
$tfsCollectionUrl = 'http://YourServer:8080/tfs/YourCollection' 
$tfsCollection = New-Object -TypeName Microsoft.TeamFoundation.Client.TfsTeamProjectCollection -ArgumentList $tfsCollectionUrl
$tfsVersionControl = $tfsCollection.GetService([Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer])

# Register PowerShell commands
Add-PSSnapin Microsoft.TeamFoundation.PowerShell

# Get all directories and files in the AutoDeploy directory
$items = Get-TfsChildItem $AutoDeployDir -Recurse

# Download each item to a specific destination
foreach ($item in $items) {
    # Serverpath of the item
    Write-Host "TFS item to download:" $($item.ServerItem) -ForegroundColor Blue

    $destinationPath = $item.ServerItem.Replace($AutoDeployDir, $deployDirectory)
    Write-Host "Download to" $([IO.Path]::GetFullPath($destinationPath)) -ForegroundColor Blue

    if ($item.ItemType -eq "Folder") {
        New-Item $([IO.Path]::GetFullPath($destinationPath)) -ItemType Directory -Force
    }
    else {
        # Download the file (not folder) to destination directory
        $tfsVersionControl.DownloadFile($item.ServerItem, $([IO.Path]::GetFullPath($destinationPath)))
    }
}
Link to comment
Share on other sites

On 9/23/2016 at 10:28 PM, Spartan said:

Visual Studio vadite..auto sync aitad kada Team Explorer nunchi.

What IDE are u using...TFS ante...i think u shud be using VS right.

 

 

actually the requirement is within the application. 

actual requirement is, once developers checkin the code into tfs, manually they deploy the code into continues integration server and from there to dev, qa, etc.

ippudu after checkin from developer into tfs, we have to update those checkins in the intermediate server  by using powershell scripts. from there we are deploying it into other servers. ya we are using VS 11.0.

Link to comment
Share on other sites

3 minutes ago, SonaParv_522 said:

actually the requirement is within the application. 

actual requirement is, once developers checkin the code into tfs, manually they deploy the code into continues integration server and from there to dev, qa, etc.

ippudu after checkin from developer into tfs, we have to update those checkins in the intermediate server  by using powershell scripts. from there we are deploying it into other servers. ya we are using VS 11.0.

Auto build scripts vuntai kada uncle may be use jenkins build tool for automation

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...