< Back

Copy-TestResult

Sat Jan 11, 2020 8:39 am

NAME Copy-TestResult



SYNOPSIS

Retrieves test results from a specific Azure DevOps build. If no build details are provided, the current

build environment is used based on the Azure DevOps environment variables.





SYNTAX

Copy-TestResult [-OutputFolder] <String> [[-ProjectUri] <Uri>] [[-AccessToken] <String>] [[-BuildUri] <String>]

[[-TrxDependencyPath] <String>] [<CommonParameters>]





DESCRIPTION

Retrieves the test attachments from a build and places them in a specified location.





PARAMETERS

-OutputFolder <String>

The location for storing the test results. Tests will be organized based on the expected

folder conventions for SonarQube and the contents of any downloaded TRX files.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-ProjectUri <Uri>

The URI to the project root in Azure DevOps.



Required? false

Position? 2

Default value $script:AzDOBuild.ProjectUri

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-AccessToken <String>

The PAT token or authorization token to use for requesting the build details.



Required? false

Position? 3

Default value $script:AzDOBuild.AccessToken

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-BuildUri <String>

The VSTFS URI for the build whose test results should be downloaded.



Required? false

Position? 4

Default value $script:AzDOBuild.BuildUri

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-TrxDependencyPath <String>

The format string to use for creating child folders for the TRX file dependencies. The string can utilize a

replacement variable, $folder,

which indicates the folder path for a given dependency (as specified in the TRX file). A second variable,

$trxFolder, is the safe folder

based on the name of the TRX file. The default path is '$trxFolder/In/$folder'. Note that the path string

should not be double-quoted

when the replacement variables are used. All folder paths will be relative to OutputFolder.



Required? false

Position? 5

Default value $trxFolder/In/$folder

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



Copy-TestResult -ProjectUri https://dev.azure.com/myorg/project -AccessToken <PAT>-BuildUri

vstfs:///Build/Build/1234 -OutputFolder c:\\test-results -TrxDependencyPath 'In/$folder'















RELATED LINKS