Skip to content

New-Installer

SYNOPSIS

Creates a new MSI installer.

SYNTAX

New-Installer -ProductName <String> [-Version <Version>] [-Manufacturer <String>] -UpgradeCode <Guid>
 [-ProductId <String>] [-Platform <String>] -OutputDirectory <DirectoryInfo> -Content <ScriptBlock>
 [-HelpLink <String>] [-AboutLink <String>] [-RequiresElevation] [-UserInterface <UserInterface>]
 [-AddRemoveProgramsIcon <FileInfo>] [-CustomAction <CustomAction[]>] [<CommonParameters>]

DESCRIPTION

Creates a new MSI installer. Files and directories can be added with New-InstallerDirectory and New-InstallerFile.

EXAMPLES

Example 1

PS C:\>   New-Installer -ProductName "PowerShellTools" -UpgradeCode "25d7c902-c46c-44fd-87e0-0000bee726de" -Version '2.1' -OutputDirectory $OutputDir -Content {
            New-InstallerDirectory -PredefinedDirectory "LocalAppDataFolder" -Content {
                New-InstallerDirectory -DirectoryName "PowerShell Tools" {
                    New-InstallerDirectory -DirectoryName "images" {
                        Get-ChildItem (Join-Path $PSScriptRoot "InstallerAssets\*.JPG") | New-InstallerFile -Verbose
                    }
                    Get-ChildItem (Join-Path $PSScriptRoot "InstallerAssets\*.exe") | New-InstallerFile -Verbose
                }
            } 
        }

Creates a new installer that puts images and exes in the AppData folder.

PARAMETERS

A link to the about page for the installer.

Type: System.String
Parameter Sets: (All)
Aliases:

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

-AddRemoveProgramsIcon

The icon to put in Add or Remove programs.

Type: System.IO.FileInfo
Parameter Sets: (All)
Aliases:

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

-Content

The content of the installer. You can use other installer cmdlets to define the content.

Type: System.Management.Automation.ScriptBlock
Parameter Sets: (All)
Aliases:

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

A help link to include in the installer.

Type: System.String
Parameter Sets: (All)
Aliases:

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

-Manufacturer

The manufacturer to set in the installer. This will appear in Add or Remove prorgams.

Type: System.String
Parameter Sets: (All)
Aliases:

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

-OutputDirectory

The output directory to place the MSI and build artifacts.

Type: System.IO.DirectoryInfo
Parameter Sets: (All)
Aliases:

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

-Platform

The platform this installer is intended to be run on.

Type: System.String
Parameter Sets: (All)
Aliases:
Accepted values: x86, x64, ia64, arm, intel, intel64

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

-ProductName

The name of the product. This will appear in Add or Remove Programs.

Type: System.String
Parameter Sets: (All)
Aliases:

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

-RequiresElevation

Specifies whether this installer requires elevation. This will require the user to have adminisrative permissions.

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

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

-UpgradeCode

The upgrade code for this installer. This GUID needs to be unique and remain the same for all versions of your installer.

Type: System.Guid
Parameter Sets: (All)
Aliases:

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

-UserInterface

User interface options defined by New-InstallerUserInterface.

Type: PowerShellToolsPro.Cmdlets.Installer.Models.UserInterface
Parameter Sets: (All)
Aliases:

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

-Version

The version of this installer. Installers prevent downgrades to older versions.

Type: System.Version
Parameter Sets: (All)
Aliases:

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

-CustomAction

{{ Fill CustomAction Description }}

Type: PowerShellToolsPro.Cmdlets.Installer.Models.CustomAction[]
Parameter Sets: (All)
Aliases:

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

-ProductId

{{ Fill ProductId Description }}

Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
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.

INPUTS

None

OUTPUTS

System.Object

NOTES

Back to top