New-GocsPackage
SYNOPSIS
Create an Update Service package with the given parameters.
SYNTAX
New-GocsPackage [-Id] <String> [-Name] <String> [[-DisplayName] <String>] [[-Description] <String>]
[-Version] <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
Create a new Update Service 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-GocsPackage @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
Package identifier.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Name
Package name, independent of version. Name from latest version is always used.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-DisplayName
Package display name.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Description
{{Fill Description Description}}
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Version
Version of the package on the form X[.Y[.Z[.C]] (i.e. 1.0, 1.0.1, 1.0.1.2334). Can also provide a path to executable to fetch the version.
Type: Object
Parameter Sets: (All)
Aliases:
Required: True
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-OutputDir
Path where the package will be saved (include .zip as extension).
Type: Object
Parameter Sets: (All)
Aliases: Output, OutputPath
Required: True
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-InputPath
{{Fill InputPath Description}}
Type: Object
Parameter Sets: (All)
Aliases: Include, IncludePaths
Required: False
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Commands
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: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Parameters
List of parameters that the package accepts.
Example: $Parameters = @( New-GocsParameter -Key 'ParameterName' -Description 'Name of parameter' -Required )
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 9
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Dependencies
A dictionary of dependencies for the package. Add package ids as the dictionary key and a version number as the value. Example:
$Dependencies = @{
'package-id' = '1.0'
'another-id' = '1.0.0.1'
}
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 10
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-FillParameters
Fill parameters for other packages in same dependency tree. Can be used to create simplified setup for general packages.
$FillParameters = @{
'package-id' = @{
'path' = 'c:\path\to\location'
}
'another-id' = @{
'defaultUser' = 'JohnDoe'
}
}
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 11
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-PrefetchFiles
List of files to prefetch before package installation (for validation), must be relative to package directory.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 12
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-StoreFiles
List of files to store in package after the package has been installed (files necessary to remove the package).
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 13
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-SubstituteFor
{{ Fill SubstituteFor Description }}
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 14
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-WindowsUpdateSensitive
{{ Fill WindowsUpdateSensitive Description }}
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-AlwaysUpdateDependencies
{{Fill AlwaysUpdateDependencies Description}}
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Instance
A switch if the package can be installed as an instance. Allowing to install multiple instances of the package.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Force
{{Fill Force Description}}
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.