简体   繁体   中英

TFS PowerShell Snapin: How To Read Team Foundation Workspace Version

  1. How to get the version of the workspace that we have locally.
  2. So basically what was the changeset number at the time of "Get Latest Changes" or "Advanced > Get Specific Version..."
  3. We need this in order to inject this information as version number for our application.

What we tried:

$history = Get-TfsItemHistory $SearchPath -Stopafter 1 -Recurse | Select ChangesetId

But it returns not the latest version we have in the workspace. It returns latest version from server.

So how can we get the team foundation workspace version with a similar command?

( Is there even a workspace version? Because it is possible that we locally do not have of all files the latest version. For example if there is a outstanding/pending merge. )

Some additional background information:

We do not have a build server yet. We create the release basically manually and execute that script manually in order to figure out changeset number and set into version info json file of our project.

在命令中添加“ -Version W”:

$history = Get-TfsItemHistory $SearchPath -Stopafter 1 -Recurse -Version W | Select ChangesetId

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM