New-Metapackage
SYNOPSIS
Creates a new Chocolatey meta (virtual) package.
SYNTAX
__AllParameterSets
New-Metapackage [-Id] <string> [-Summary] <string> [-Dependency] <hashtable[]> -Description <string>
[-Path <string>] [-Version <string>] [<CommonParameters>]
ALIASES
None
DESCRIPTION
New-Metapackage generates the .nuspec file needed to define a Chocolatey metapackage — a package that contains no software itself but declares a set of dependencies that will be installed together. The nuspec is written to -Path (defaults to the current directory) and can optionally be given an explicit semantic version.
EXAMPLES
EXAMPLE 1
Create a minimal metapackage using only mandatory parameters
$newMetapackageSplat = @{
Id = 'dev-tools'
Summary = 'Common developer tools'
Description = 'Installs a curated set of developer tooling for new machines.'
Dependency = @{id='git'}, @{id='vscode'}, @{id='nodejs'}
}
New-Metapackage @newMetapackageSplat
EXAMPLE 2
Create a metapackage with a pre-release version saved to a custom path
$newMetapackageSplat = @{
Id = 'dev-tools'
Summary = 'Common developer tools'
Description = 'Installs a curated set of developer tooling for new machines.'
Dependency = @{id='git'; version='2.44.0'}, @{id='putty'}
Version = '1.0.0-pre'
Path = 'C:\chocopackages'
}
New-Metapackage @newMetapackageSplat
PARAMETERS
-Dependency
An array of hashtables, each with an 'id' key and an optional 'version' key, describing the packages that will be pulled in when this metapackage is installed (e.g. @{id='git'; version='2.44.0'}).
Type: System.Collections.Hashtable[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 2
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Description
A longer description of the metapackage. Must be at least 30 characters.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Id
The package id for the metapackage (e.g.
'dev-tools').
Used as the nuspec
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Path
The directory in which to write the generated .nuspec file. Defaults to the current working directory.
Type: System.String
DefaultValue: $PWD
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Summary
A short, one-line summary of what the metapackage installs.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 1
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Version
A valid semantic version for the package (e.g. '1.0.0' or '1.0.0-pre'). Defaults to '0.1.0'.
Type: System.String
DefaultValue: 0.1.0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
OUTPUTS
NOTES
This function requires Chocolatey to be installed so that the metapackage template can be placed in the standard templates directory.
Alias: New-VirtualPackage