Link

Export-TfsWorkItemQuery

Exports a saved work item query to XML.


Table of Contents

  1. Syntax
  2. Description
  3. Parameters
  4. Inputs
  5. Outputs
  6. Related Links

Syntax

Export to file

Export-TfsWorkItemQuery
    [-Query] <object>
    -Destination <string>
    [-Collection <object>]
    [-Encoding <string>]
    [-FlattenFolders]
    [-Force]
    [-Project <object>]
    [-Scope <string>]
    [-Server <object>]

Export to output stream

Export-TfsWorkItemQuery
    [-Query] <object>
    -AsXml
    [-Collection <object>]
    [-Project <object>]
    [-Scope <string>]
    [-Server <object>]

[Go to top]

Description

Work item queries can be exported to XML files (.WIQ extension) in order to be shared and reused. Visual Studio Team Explorer has the ability to open and save WIQ files. Use this cmdlet to generate WIQ files compatible with the format supported by Team Explorer.

[Go to top]

Parameters

-AsXml

Exports the saved query to the standard output stream as a string-encoded XML document.

Type SwitchParameter
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-Collection (Aliases: Organization)

Specifies the URL to the Team Project Collection or Azure DevOps Organization to connect to, a TfsTeamProjectCollection object (Windows PowerShell only), or a VssConnection object. You can also connect to an Azure DevOps Services organizations by simply providing its name instead of the full URL. For more details, see the Get-TfsTeamProjectCollection cmdlet. When omitted, it defaults to the connection set by Connect-TfsTeamProjectCollection (if any).

Type object
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-Destination

Specifies the path to the folder where exported queries are saved.

Type string
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-Encoding

Specifies the encoding for the exported XML files. When omitted, defaults to UTF-8.

Type string
Position (Named)
Default Value UTF-8
Accept pipeline input False
Accept wildcard characters False

-FlattenFolders

Flattens the query folder structure. When omitted, the original query folder structure is recreated in the destination folder.

Type SwitchParameter
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-Force

Allows the cmdlet to overwrite an existing file in the destination folder.

Type SwitchParameter
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

-Project

Specifies the name of the Team Project, its ID (a GUID), or a Microsoft.TeamFoundation.Core.WebApi.TeamProject object to connect to. When omitted, it defaults to the connection set by Connect-TfsTeamProject (if any). For more details, see the Get-TfsTeamProject cmdlet.

Type object
Position (Named)
Default Value (N/A)
Accept pipeline input True (byvalue)
Accept wildcard characters False

-Query (Aliases: Path)

Specifies one or more saved queries to export. Wildcards supported.

Type object
Position 0
Default Value (N/A)
Accept pipeline input True (byvalue)
Accept wildcard characters False

-Scope

Specifies the scope of the returned item. Personal refers to the “My Queries” folder”, whereas Shared refers to the “Shared Queries” folder. When omitted defaults to “Both”, effectively searching for items in both scopes.

Type string
Position (Named)
Default Value Both
Accept pipeline input False
Accept wildcard characters False

-Server

Specifies the URL to the Team Foundation Server to connect to, a TfsConfigurationServer object (Windows PowerShell only), or a VssConnection object. When omitted, it defaults to the connection set by Connect-TfsConfiguration (if any). For more details, see the Get-TfsConfigurationServer cmdlet.

Type object
Position (Named)
Default Value (N/A)
Accept pipeline input False
Accept wildcard characters False

Inputs

System.Object

Specifies one or more saved queries to export. Wildcards supported.

System.Object

Specifies the name of the Team Project, its ID (a GUID), or a Microsoft.TeamFoundation.Core.WebApi.TeamProject object to connect to. When omitted, it defaults to the connection set by Connect-TfsTeamProject (if any). For more details, see the Get-TfsTeamProject cmdlet.

Outputs

System.String