SQL Change Automation 3

Import-DatabaseBuildArtifact

Import-DatabaseBuildArtifact

Imports a build artifact to an instance of an IBuildArtifact object.

Syntax

Import-DatabaseBuildArtifact [-Path] <string> [<CommonParameters>]

Description

The Import-DatabaseBuildArtifact cmdlet uses an on disk build artifact to create a IBuildArtifact object that can be used as the input for other cmdlets such as Publish-DatabaseBuildArtifact.

Parameters

-Path <System.String>

The path to the build artifact file (eg 'C:\Work\buildArtifacts\MyDatabase.1.0.0.nupkg').

Aliases None
Required? true
Position? 0
Default Value None
Accept Pipeline Input true (ByValue)
Accept Wildcard Characters false

<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.

  • System.String

    The path to the build artifact file (eg 'C:\Work\buildArtifacts\MyDatabase.1.0.0.nupkg').

Return values

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

  • RedGate.Versioning.Automation.Compare.Domain.BuildArtifacts.IBuildArtifact

Examples

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

$buildArtifactPath = "C:\Work\buildArtifacts\MyDatabase.1.0.0.nupkg"
$buildArtifact = $buildArtifactPath | Import-DatabaseBuildArtifact
$buildArtifact | Publish-DatabaseBuildArtifact -NuGetFeedUrl http://localhost:4000/nuget/packages -NuGetApiKey ed6d7c98-9847-4599-b5a8-323f215b5c89

This example shows how to use the Import-DatabaseBuildArtifact cmdlet to create a IBuildArtifact object from a build artifact exported as NuGet package. The Publish-DatabaseBuildArtifact cmdlet then publishes the output object to a NuGet feed.

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

$buildArtifactPath = "C:\Work\buildArtifacts\MyDatabase.zip"
$buildArtifact = $buildArtifactPath | Import-DatabaseBuildArtifact

This example shows how to use the Import-DatabaseBuildArtifact cmdlet to create a IBuildArtifact object from a build artifact exported as a .zip file.


Didn't find what you were looking for?