Skip to content

New-CommanderToolbarIcon

SYNOPSIS

Creates a notification tray toolbar icon.

SYNTAX

New-CommanderToolbarIcon [[-Text] <String>] [[-MenuItem] <MenuItem[]>] [[-LoadMenuItems] <ScriptBlock>]
 [-HideExit] [-HideConfig] [[-Icon] <String>] [<CommonParameters>]

DESCRIPTION

Creates a notification tray toolbar icon.

EXAMPLES

EXAMPLE 1

New-CommanderToolbarIcon -MenuItem @(
    New-CommanderMenuItem -Text 'Notepad' -Action {
        Start-Process notepad
    } -MenuItem @(
        New-CommanderMenuItem -Text 'Subnotepad' -Action {
            Start-Process notepad
        }
    ) -LoadMenuItems {  
        New-CommanderMenuItem -Text 'Dynamic SubNotepad' -Action {
            Start-Process notepad
        }
    }
) -LoadMenuItems {
    New-CommanderMenuItem -Text 'Dynamic Notepad' -Action {
        Start-Process notepad
    }
}

Creates a tool bar icon with several menu items.

PARAMETERS

-Text

Text to display when the icon is hovered.

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

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

-MenuItem

Menu items to display when the icon is right clicked.

Type: pscommander.MenuItem[]
Parameter Sets: (All)
Aliases:

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

-LoadMenuItems

A script block to call to dynamically load menu items.

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

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

-HideExit

Hides the exit menu item.

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

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

-HideConfig

Hides the config menu item.

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

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

-Icon

Path to an icon file to display in the toolbar.

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

Required: False
Position: 4
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

OUTPUTS

NOTES

Back to top