DLM Automation

Export-DlmDatabaseTestResults

Export-DlmDatabaseTestResults

Exports a TestResults object to disk.

Syntax

Export-DlmDatabaseTestResults [-InputObject] <TestResults> -OutputFile <string> [-Format <TestResultsFormat>] [-Force] [<CommonParameters>]

Description

The Export-DlmDatabaseTestResults cmdlet takes a TestResults results object produced by the Invoke-DlmDatabaseTests cmdlet and exports it to a JUnit or MsTest file.

Parameters

-InputObject <RedGate.DLMAutomation.Compare.SchemaTesting.TestResults>

The TestResults object to be exported.

Aliases None
Required?true
Position?0
Default Value None
Accept Pipeline Inputtrue (ByValue)
Accept Wildcard Charactersfalse

-OutputFile <System.String>

The file path to export the TestResults to.

Aliases None
Required?true
Position?named
Default Value None
Accept Pipeline Inputfalse
Accept Wildcard Charactersfalse

-Format <RedGate.DLMAutomation.Compare.SchemaTesting.Export.TestResultsFormat>

The format of the TestResults file. This can be JUnit or MsTest.

If you don't use this parameter, or if you set it to Default, the format will be chosen automatically depending on the file extension of the OutputFile.

Possible values: Default, JUnit, MsTest

Aliases None
Required?false
Position?named
Default ValueDefault
Accept Pipeline Inputfalse
Accept Wildcard Charactersfalse

-Force <System.Management.Automation.SwitchParameter>

Use this parameter to overwrite any existing file specified by OutputFile.

Aliases None
Required?false
Position?named
Default ValueFalse
Accept Pipeline Inputfalse
Accept Wildcard Charactersfalse

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see http://technet.microsoft.com/en-us/library/hh847884.aspx.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • RedGate.DLMAutomation.Compare.SchemaTesting.TestResults

    The TestResults object to be exported.

Return values

The output type is the type of the objects that the cmdlet emits.

  • None

Examples

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

$testResultsFile = "C:\Work\TestResults\scripts.junit.xml"
$results = Invoke-DlmDatabaseTests "C:\Work\Scripts"
Export-DlmDatabaseTestResults $results -OutputFile $testResultsFile

This example demonstrates the simplest use of Export-DlmDatabaseTestResults, only specifying the OutputFile parameter to export the results of the tests to a JUnit file.

---------- EXAMPLE 2 ----------

$testResultsFile = "C:\Work\TestResults\scripts.xml"
Invoke-DlmDatabaseTests "C:\Work\Scripts" | Export-DlmDatabaseTestResults -OutputFile $testResultsFile -Format MSTest

This example shows how to specify the format of the test results file. This can be JUnit or MSTest.

If you don't use the Format parameter, or if you set it to Default, the format will be chosen automatically depending on the file extension of the OutputFile.

---------- EXAMPLE 3 ----------

$testResultsFile = "C:\Work\TestResults\scripts.junit.xml"
$results = Invoke-DlmDatabaseTests "C:\Work\Scripts"
Export-DlmDatabaseTestResults $results -OutputFile $testResultsFile -Force

This example shows how to overwrite an existing test results file using the Force parameter.


Didn't find what you were looking for?