PsDac

PsDac connects DacFx and PowerShell. It gives you PowerShell Cmdlets with the power of Microsoft.SqlServer.DacFx.

View the Project on GitHub abbgrade/PsDac

Import-DacPackage

SYNOPSIS

Imports the package from a dacpac or a database.

SYNTAX

File

Import-DacPackage [-Path] <FileInfo> [-Access <FileAccess>] [-Service <DacServices>] [<CommonParameters>]

Database

Import-DacPackage [-DatabaseName <String>] -ApplicationName <String> -ApplicationVersion <Version>
 [-Service <DacServices>] [<CommonParameters>]

DESCRIPTION

Imports a DacPackage from a DacPac file or a database. If it loaded from a database, a connection must be established before.

EXAMPLES

Example 1

PS C:\> 

PARAMETERS

-Access

Specifies if the file is opened for read or write access.

Type: FileAccess
Parameter Sets: File
Aliases:
Accepted values: Read, Write, ReadWrite

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ApplicationName

Identifier for the DAC application.

Type: String
Parameter Sets: Database
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ApplicationVersion

Version of the DAC application.

Type: Version
Parameter Sets: Database
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DatabaseName

Name of the source database.

Type: String
Parameter Sets: Database
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Path

Specifies the path to the dacpac to load the package from.

Type: FileInfo
Parameter Sets: File
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-Service

Specifies the server to extract the package from. Default is the latest connected service.

Type: DacServices
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.IO.FileInfo

OUTPUTS

Microsoft.SqlServer.Dac.DacPackage

NOTES

DacPackage