The Get task retrieves a read-only copy of the files and folders in a workspace by using specified options.
Specifies the build URI.
Specifies the workspace name.
Specifies the file versionspec. By default the versionspec used is T, or the latest version. Set the GetVersion property in TFSBuild.proj file to get a different version. This behavior corresponds to the /version option of tf.exe get command. For more information, see Get Command.
Specifies the items in the workspace. By default, Team Foundation Build gets all items in the workspace specified by the WorkspaceName property. Override the GetFileSpec property in TFSBuild.proj file to specify a specific Itemspec. This corresponds to the Itemspec parameter of tf.exe get command.
By default, Team Foundation Build does not return the list of items that were retrieved, replaced, or deleted, nor does it return warnings generated by the Get task. Set the GetPopulateOutput property to true in TFSBuld.proj file to make these lists available. When you set GetPopulateOutput to true, the following is returned:
Specifies whether to display what would occur without actually performing the Get operation. Set PreviewGet to true in TFSBuild.proj file to preview the Get operation. This corresponds to the /preview option of tf.exe get command.
Specifies whether files are retrieved recursively. Set the RecursiveGet property to false in the TfsBuild.proj file to perform a non-recursive get in a Team Foundation Build project. This corresponds to the /recursive option of tf.exe get command.
Specifies whether the files are retrieved incrementally. To do an incremental get in a Team Foundation Build definition, set the ForceGet property to false in the TfsBuild.proj file. Corresponds to the /force option of tf.exe get command.
Output parameter. Specifies the list of items that were retrieved by the Get task.
Output parameter. Specifies the list of items that were replaced by the Get task
Output parameter. Specifies the list of items that were deleted by the Get task
Output parameter. Specifies the list of warnings that were generated by the Get task
The Get task is defined in the Microsoft.TeamFoundation.Build.Tasks.VersionControl.dll. The Microsoft.TeamFoundation.Build.targets file contains an instance of the Get task that Team Foundation Build uses as a default implementation for the CoreGet target.
The <root>:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild folder on the Team Foundation Build computer contains the Microsoft.TeamFoundation.Build.targets file.
The following example shows the default instance of Get task defined in the Microsoft.TeamFoundation.Build.targets file.
<Get TeamFoundationServerUrl="$(TeamFoundationServerUrl)" BuildUri="$(BuildURI)" Workspace="$(WorkspaceName)" Version="$(GetVersion)" Filespec="$(GetFilespec)" PopulateOutput="$(GetPopulateOutput)" Preview="$(PreviewGet)" Recursive="$(RecursiveGet)" Force="$(ForceGet)"> <Output TaskParameter="Gets" ItemName="Gets" /> <Output TaskParameter="Replaces" ItemName="Replaces" /> <Output TaskParameter="Deletes" ItemName="Deletes" /> <Output TaskParameter="Warnings" ItemName="GetWarnings" /> </Get>