New-CMPackage

Creates a Configuration Manager package.

Syntax

New-CMPackage
   [-Description <String>]
   [-Language <String>]
   [-Manufacturer <String>]
   -Name <String>
   [-Path <String>]
   [-Version <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CMPackage
   [-FromDefinition]
   -PackageDefinitionName <String>
   [-PackageNoSourceFile]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CMPackage
   [-FromDefinition]
   [-PackageNoSourceFile]
   -PackagePath <String>
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CMPackage
   [-FromDefinition]
   -PackageDefinitionName <String>
   -SourceFileType <SourceFileType>
   -SourceFolderPath <String>
   -SourceFolderPathType <SourceFolderPathType>
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CMPackage
   [-FromDefinition]
   -PackagePath <String>
   -SourceFileType <SourceFileType>
   -SourceFolderPath <String>
   -SourceFolderPathType <SourceFolderPathType>
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-CMPackage cmdlet creates a Configuration Manager package. A package is a Configuration Manager object that contains the content files and instructions for distributing programs, software updates, boot images, operating system images, and drivers to Configuration Manager clients.

Note

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

Examples

Example 1: Create a package

PS XYZ:\> New-CMPackage -Name "ScriptsPackage01"

This command creates a Configuration Manager package named ScriptsPackage01.

Example 2: Create a package and add a description

PS XYZ:\> New-CMPackage -Name "ScriptsPackage02" -Description "This package deploys scripts that run on a recurring schedule."

This command creates a Configuration Manager package named ScriptsPackage02 and adds the specified description to the package.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-Description

Specifies a description for the package. You can use a maximum of 128 characters.

Type:String
Position:Named
Default value:None
Required: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
Required:False
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FromDefinition

Indicates that Configuration Manager creates the package from a package definition file.

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

-Language

Specifies the language version of the package. You can use a maximum of 32 characters in a format that you choose to use to identify the language version. Configuration Manager uses the Language parameter together with Manufacturer, Name, and Version to identify a package. For example, you can have an English version and a German version of the same package.

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

-Manufacturer

Specifies a manufacturer name to help you identify the package. You can use a maximum of 32 characters.

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

-Name

Specifies a name for the package.

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

-PackageDefinitionName

Specifies the name of a package definition file.

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

-PackageNoSourceFile

Indicates that the package does not require source files to be present on client devices.

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

-PackagePath

Specifies a share name or path that Configuration Manager creates for the package source files on distribution points.

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

-Path

Specifies the location of the files to add to the package.

You can specify either a full local path or a UNC path. Make sure that this location contains all the files and subdirectories that the program needs to complete, including any scripts.

Type:String
Aliases:PackageSourcePath
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SourceFileType

Specifies the source file type. The acceptable values for this parameter are:

  • AlwaysObtainSourceFile
  • CreateCompressedVersionOfSourceFile
Type:SourceFileType
Accepted values:AlwaysObtainSourceFile, CreateCompressedVersionOfSourceFile
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SourceFolderPath

Specifies the location of the source files for the package.

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

-SourceFolderPathType

Specifies the source folder path type. The acceptable values for this parameter are:

  • LocalFolderOnSiteServer
  • UncNetworkPath
Type:SourceFolderPathType
Accepted values:UncNetworkPath, LocalFolderOnSiteServer
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Version

Specifies a version number for the package.

Type:String
Position:Named
Default value:None
Required:False
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

IResultObject