Skip to content

New-InstallerShortcut

SYNOPSIS

Adds a new shortcut to the installer.

SYNTAX

New-InstallerShortcut -FileId <String> -Name <String> [-Description <String>] [-IconPath <String>]
 [-WorkingDirectoryId <String>] [-Arguments <String>] [-Show <String>] [<CommonParameters>]

DESCRIPTION

Adds a new shortcut to the installer.

EXAMPLES

Example 1

PS C:\>  New-Installer -Manufacturer "Test" -ProductName "PowerShellTools" -UpgradeCode "25d7c902-c46c-44fd-87e0-0756bee726de" -Version '2.1' -OutputDirectory $OutputDir -Content {
            New-InstallerDirectory -PredefinedDirectory "LocalAppDataFolder" -Content {
                New-InstallerDirectory -DirectoryName "PowerShell Tools" -Content {
                    New-InstallerFile (Join-Path $PSScriptRoot "InstallerAssets\heat.exe") -Id "heat"
                }
            } 
            New-InstallerDirectory -PredefinedDirectory "DesktopFolder" -Content {
                New-InstallerShortcut -FileId "heat" -Name "Launch heat" -IconPath (Join-Path $PSScriptRoot "InstallerAssets\app.ico")
            }
        }

Creates a shortcut on the desktop the heat.exe filder that is installed into AppData.

PARAMETERS

-Description

A description for the shortcut.

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

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

-FileId

The ID of the file for the shortcut to point to.

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

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

-IconPath

The path of an icon to use for the shortcut.

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

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

-Name

The name of the shortcut.

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

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

-Arguments

{{ Fill Arguments Description }}

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

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

-Show

{{ Fill Show Description }}

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

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

-WorkingDirectoryId

{{ Fill WorkingDirectoryId 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