Import-CMPackage

Import a legacy package.

Syntax

Import-CMPackage
      [-ImportActionType <ImportActionType>]
      -ImportFilePath <String>
      [-DisableWildcardHandling]
      [-ForceWildcardHandling]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Use this cmdlet to import a Configuration Manager legacy package. You can use the Export-CMPackage cmdlet to export a legacy package to a .zip file.

Configuration Manager current branch continues to support packages and programs that were used in Configuration Manager 2007. For more information, see Packages and programs in Configuration Manager.

Important

This cmdlet doesn't support PowerShell 7. It requires the .NET Framework instead of .NET Core that's used with PowerShell version 7.

Starting in version 2103, if you try to use this cmdlet in a PowerShell version 7 session, it fails with the following error: This cmdlet only supports the ".NET Framework" runtime.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Import a package

This command imports a package from a network path.

Import-CMPackage -ImportFilePath "\\Deploy01\ExportPackages"

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

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

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

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

-ImportActionType

If this package already exists in the site, use this parameter how to handle it. By default, Configuration Manager ignores duplicates.

Type:ImportActionType
Accepted values:NotSet, Skip, DirectImport, Rename, Overwrite, ImportFail, IgnoreDependencyFailure, AppendDriverCategories, OverwriteIgnoreDependencyFailure
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-ImportFilePath

Specify the network path for the exported package. The cmdlet imports all packages in the file. The path needs to specify the file, including the .zip extension.

Type:String
Aliases:FileName, FilePath, Path
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet doesn't run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

System.Object