New-UssPackage
SYNOPSIS
Create a new package archive.
SYNTAX
New-UssPackage [-Id] <String> [-Name] <String> [[-DisplayName] <String>] [[-Description] <String>]
[-Version] <Object> [[-MinClientVersion] <Object>] [-OutputDir] <Object> [[-InputPath] <Object>]
[[-Commands] <Object>] [[-Parameters] <Object>] [[-Dependencies] <Object>] [[-FillParameters] <Object>]
[[-PrefetchFiles] <Object>] [[-StoreFiles] <Object>] [[-SubstituteFor] <Object>] [-WindowsUpdateSensitive]
[-AlwaysUpdateDependencies] [-Instance] [-Force] [<CommonParameters>]
DESCRIPTION
Use New-UssPackage
to create a new package archive.
EXAMPLES
Example 1
$ExampleApp = @{
Id = 'example-app'
Name = 'Example App'
Version = '1.0'
Commands = @{
Install = 'Package.psm1:Install-Package'
Update = 'Package.psm1:Install-Package'
}
InputPath = @(
Join-Path $PSScriptRoot 'example-app\*' # Add all files to package from directory.
)
OutputDir = (Join-Path $PSScriptRoot 'Output')
}
New-UssPackage @ExampleApp
Create a new package example_app v1.0, which will execute the Install-Package
function during both install and update phase of the package. It will include all file in the example-app directory.
PARAMETERS
-Id
Specifies the ID of the package.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Name
Specifies the name of the package.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-DisplayName
Specifies the display name of the package.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Description
Specifies the description of the package.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Version
Specifies the version of the packag on the form X[.Y[.Z[.C]] (i.e.1.0, 1.0.1, 1.0.1.2334).
Type: Object
Parameter Sets: (All)
Aliases:
Required: True
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-MinClientVersion
Specifies the minimal client version needed to install the package.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-OutputDir
Specifies the output directory.
Type: Object
Parameter Sets: (All)
Aliases: Output, OutputPath
Required: True
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-InputPath
Specifies the path to the files to include in the package.
Type: Object
Parameter Sets: (All)
Aliases: Include, IncludePaths
Required: False
Position: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Commands
Specifies the commands that the package implements.
A dictionary of commands and functions that the package implements. On the form:
'command' = 'PathToModule.psm1:Function-CalledOnExecution'
Following commands are available: install: Executed during first install of the package. update: Executed when updating the package with a new version. finalize: Executed after all packages that depend on this package has been installed/updated. rollaback: Executed if an install or update fails. remove: Executed to remove the package.
Example: $Commands = @{
'install' = 'Package.psm1:Install-Package'
'update' = 'Package.psm1:Update-Package'
}
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 9
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Parameters
Specifies the parameters that the package implements.
Example:
$Parameters = @(
New-UssParameter -Key 'ParameterName' -Description 'Name of parameter' -Required
)
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 10
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Dependencies
Specifies the dependencies of the package.
Example:
$Dependencies = @{
'package-id' = '1.0'
'another-id' = '1.0.0.1'
}
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 11
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-FillParameters
Specifies parameters to fill for other packages in the same dependency tree.
$FillParameters = @{
'package-id' = @{
'path' = 'c:\path\to\location'
}
'another-id' = @{
'defaultUser' = 'JohnDoe'
}
}
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 12
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-PrefetchFiles
Specifies files to prefetch before package installation.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 13
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-StoreFiles
Specifies files to store on the client machine after the package has been installed. This may be files or scripts needed for package removal.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 14
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-SubstituteFor
Specifies the package ID that this package substitutes.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 15
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-WindowsUpdateSensitive
Specifies if the package is sensitive to Windows Update.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-AlwaysUpdateDependencies
Specifies if the package should always update dependencies.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Instance
Specifies if the package can be installed as an instance.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Force
Specifies that the package should be created even if it already exists on the file system.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
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.