Import-CrmPackage

Applies To: CRM 2015 on-prem

Import-CrmPackage

Imports a package to a Microsoft Dynamics CRM instance.

Syntax

Parameter Set: Default
Import-CrmPackage -CrmConnection <CrmServiceClient> -PackageName <String> [-AllowCustomCode <String> ] [-PackageDirectory <String> ] [-TimeOut <String> ] [-UnpackFilesDirectory <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Import-CrmPackage cmdlet imports a package to a CRM instance. A package can contain CRM solution files, files or exported data files from the Configuration Migration tool, custom code that can run during or after the package is deployed to the CRM instance, and HTML content specific to the package that can display at the beginning and end of the package deployment process. The HTML content can be useful to provide a description of the solutions and files that are deployed in the package.

This cmdlet applies to Microsoft Dynamics CRM Online and on-premises versions of Microsoft Dynamics CRM.

Parameters

-AllowCustomCode<String>

For internal use only.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CrmConnection<CrmServiceClient>

Connection object to the CRM instance. This is an initialized instance of the Microsoft.Xrm.Tooling.Connector class.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-PackageDirectory<String>

Directory where a package or packages can be found.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-PackageName<String>

Name of the assembly (.dll) that contains the package definition.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-TimeOut<String>

For internal use only.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-UnpackFilesDirectory<String>

Directory where the files are extracted to. If your package doesn’t have files that need to be unpacked or extracted, you don’t have to specify this parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

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

Outputs

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

Examples

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

This example imports a package defined by SampleCRMPackage.dll, which is available in the c:\CRM\SDK\Tools\PackageDeployer directory.

The -Verbose parameter at the end of the command is optional, and is used to display a detailed log of the activities performed during the package deployment process. For the –CrmConnection parameter, we pass the $CRMConn variable that stores the CRM connection information. We used the Get-CrmConnection cmdlet earlier to store the CRM connection information in the $CRMConn variable.

PS C:\>Import-CrmPackage -CrmConnection $CRMConn -PackageDirectory c:\CRM\SDK\Tools\PackageDeployer -PackageName SampleCRMPackage.dll -UnpackFilesDirectory c:\UnpackedFiles -Verbose

Get-CrmPackages

Use Windows PowerShell to deploy packages