SimpleMenu-Help.xml

<?xml version="1.0" encoding="utf-8"?><helpItems schema="maml">
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<!--Generated by PS Cmdlet Help Editor-->
    <command:details>
        <command:name>Invoke-SimpleMenu</command:name>
        <maml:description>
            <maml:para>Calls menu interface.</maml:para>
        </maml:description>
        <maml:copyright>
            <maml:para />
        </maml:copyright>
        <command:verb>Invoke</command:verb>
        <command:noun>SimpleMenu</command:noun>
        <dev:version />
    </command:details>
    <maml:description>
        <maml:para>Calls the menu interface and loops until the menu is quitted through items defined with the Quit switch parameter. The menu will produce warning if undefined keys are pressed or no actions for a specific menu item was defined. </maml:para>
    </maml:description>
    <command:syntax>
        <command:syntaxItem>
            <maml:name>Invoke-SimpleMenu</maml:name>
            <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="0">
                <maml:name>Menu</maml:name>
                <maml:description>
                    <maml:para>Menu to be invoked. </maml:para>
                </maml:description>
                <command:parameterValue required="true" variableLength="false">SimpleMenu</command:parameterValue>
            </command:parameter>
        </command:syntaxItem>
    </command:syntax>
    <command:parameters>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="0">
            <maml:name>Menu</maml:name>
            <maml:description>
                <maml:para>Menu to be invoked. </maml:para>
            </maml:description>
            <command:parameterValue required="true" variableLength="false">SimpleMenu</command:parameterValue>
            <dev:type>
                <maml:name>SimpleMenu</maml:name>
                <maml:uri/>
            </dev:type>
            <dev:defaultValue></dev:defaultValue>
        </command:parameter>
    </command:parameters>
    <command:inputTypes>
        <command:inputType>
            <dev:type>
                <maml:name></maml:name>
                <maml:uri></maml:uri>
                <maml:description/>
            </dev:type>
            <maml:description>
<maml:para />
            </maml:description>
        </command:inputType>
    </command:inputTypes>
    <command:returnValues>
        <command:returnValue>
            <dev:type>
                <maml:name>None</maml:name>
                <maml:uri></maml:uri>
                <maml:description/>
            </dev:type>
            <maml:description>
                <maml:para>This function returns nothing.</maml:para>
            </maml:description>
        </command:returnValue>
    </command:returnValues>
    <command:terminatingErrors></command:terminatingErrors>
    <command:nonTerminatingErrors></command:nonTerminatingErrors>
    <maml:alertSet>
        <maml:title></maml:title>
        <maml:alert>
            <maml:para>Read-host will be used in ISE or if the input is redirected. Otherwise, read key is used to detect pressed key. The latter does not requires to press enter. </maml:para>
        </maml:alert>
    </maml:alertSet>
    <command:examples>
    </command:examples>
    <maml:relatedLinks>
    </maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<!--Generated by PS Cmdlet Help Editor-->
    <command:details>
        <command:name>New-SimpleMenu</command:name>
        <maml:description>
            <maml:para>Create SimpleMenu interface.</maml:para>
        </maml:description>
        <maml:copyright>
            <maml:para />
        </maml:copyright>
        <command:verb>New</command:verb>
        <command:noun>SimpleMenu</command:noun>
        <dev:version />
    </command:details>
    <maml:description>
        <maml:para>Create SimpleMenu Interface and defines menu item. Submenus should be created prior to their parent menu to allow adding them when creating it. </maml:para>
    </maml:description>
    <command:syntax>
        <command:syntaxItem>
            <maml:name>New-SimpleMenu</maml:name>
            <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="0">
                <maml:name>Title</maml:name>
                <maml:description>
                    <maml:para>Defines menu title.</maml:para>
                </maml:description>
                <command:parameterValue required="true" variableLength="false">Object</command:parameterValue>
            </command:parameter>
            <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="1">
                <maml:name>Items</maml:name>
                <maml:description>
                    <maml:para>Array of SimpleMenuItem that should be created using the New-SimpleMenuItem cmdlet. </maml:para>
                </maml:description>
                <command:parameterValue required="true" variableLength="false">Object</command:parameterValue>
            </command:parameter>
            <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="2">
                <maml:name>TitleForegroundColor</maml:name>
                <maml:description>
                    <maml:para>Foreground color of the menu title. </maml:para>
                </maml:description>
                <command:parameterValue required="true" variableLength="false">ConsoleColor</command:parameterValue>
            </command:parameter>
            <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="3">
                <maml:name>Id</maml:name>
                <maml:description>
                    <maml:para>ID of the menu. Currently unused&#233;</maml:para>
                </maml:description>
                <command:parameterValue required="true" variableLength="false">Object</command:parameterValue>
            </command:parameter>
        </command:syntaxItem>
    </command:syntax>
    <command:parameters>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="0">
            <maml:name>Title</maml:name>
            <maml:description>
                <maml:para>Defines menu title.</maml:para>
            </maml:description>
            <command:parameterValue required="true" variableLength="false">Object</command:parameterValue>
            <dev:type>
                <maml:name>Object</maml:name>
                <maml:uri/>
            </dev:type>
            <dev:defaultValue></dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="1">
            <maml:name>Items</maml:name>
            <maml:description>
                <maml:para>Array of SimpleMenuItem that should be created using the New-SimpleMenuItem cmdlet. </maml:para>
            </maml:description>
            <command:parameterValue required="true" variableLength="false">Object</command:parameterValue>
            <dev:type>
                <maml:name>Object</maml:name>
                <maml:uri/>
            </dev:type>
            <dev:defaultValue></dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="2">
            <maml:name>TitleForegroundColor</maml:name>
            <maml:description>
                <maml:para>Foreground color of the menu title. </maml:para>
            </maml:description>
            <command:parameterValue required="true" variableLength="false">ConsoleColor</command:parameterValue>
            <dev:type>
                <maml:name>ConsoleColor</maml:name>
                <maml:uri/>
            </dev:type>
            <dev:defaultValue>Cyan</dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="3">
            <maml:name>Id</maml:name>
            <maml:description>
                <maml:para>ID of the menu. Currently unused&#233;</maml:para>
            </maml:description>
            <command:parameterValue required="true" variableLength="false">Object</command:parameterValue>
            <dev:type>
                <maml:name>Object</maml:name>
                <maml:uri/>
            </dev:type>
            <dev:defaultValue></dev:defaultValue>
        </command:parameter>
    </command:parameters>
    <command:inputTypes>
        <command:inputType>
            <dev:type>
                <maml:name></maml:name>
                <maml:uri></maml:uri>
                <maml:description/>
            </dev:type>
            <maml:description>
<maml:para />
            </maml:description>
        </command:inputType>
    </command:inputTypes>
    <command:returnValues>
        <command:returnValue>
            <dev:type>
                <maml:name>SimpleMenu</maml:name>
                <maml:uri></maml:uri>
                <maml:description/>
            </dev:type>
            <maml:description>
                <maml:para>SimpleMenu class that host all details of created menu.</maml:para>
            </maml:description>
        </command:returnValue>
    </command:returnValues>
    <command:terminatingErrors></command:terminatingErrors>
    <command:nonTerminatingErrors></command:nonTerminatingErrors>
    <maml:alertSet>
        <maml:title></maml:title>
        <maml:alert>
            <maml:para />
        </maml:alert>
    </maml:alertSet>
    <command:examples>
        <command:example>
            <maml:title>-------------------------- Complete menu with submenu --------------------------</maml:title>
            <maml:introduction>
                <maml:paragraph>PS C:\&gt;</maml:paragraph>
            </maml:introduction>
            <dev:code>
$OptionsMenu = New-SimpleMenu -Title &apos;Options&apos; -TitleForegroundColor Red -Items @(
    &quot;Enter Powershell prompt&quot; | New-SimpleMenuItem -Action {Write-host &apos;Type exit to go back to menu&apos;;$host.enternestedprompt()} -NoPause
    &quot;Edit this menu&quot; | New-SimpleMenuItem -Action {powershell_ise.exe &quot;$ScriptFullPath&quot;}
    &quot;Display script full path&quot; | New-SimpleMenuItem -Action {Write-Host $ScriptFullPath -ForegroundColor Yellow}
    &quot;Back&quot; | New-SimpleMenuItem -Key b -Quit
)
 
 
$Menu = New-SimpleMenu -Title &apos;Service manager&apos; -Items @(
    &quot;Install Service&quot; | New-SimpleMenuItem -ID &apos;Install&apos; -Action {InstallService}
    &quot;Uninstall Service&quot; | New-SimpleMenuItem -Action {UninstallService}
    &quot;Options&quot; | New-SimpleMenuItem -key &apos;O&apos; -submenu $OptionsMenu
    &quot;Change title demo&quot; | New-SimpleMenuItem -Id &apos;ChangeTitle&apos; -Action {$Menu.GetItem(&apos;ChangeTitle&apos;).Title = &apos;New title !&apos;} -NoPause
    &quot;Test Error&quot; | New-SimpleMenuItem -Key &apos;d&apos; -Action {Throw &apos;Unmanaged error&apos;} -NoPause
    &quot;Exit&quot; | New-SimpleMenuItem -Key &apos;x&apos; -Action {Write-Host &apos;Farewell, see you next time !&apos; -ForegroundColor Green} -Quit -NoPause
)</dev:code>
            <dev:remarks>
                <maml:para>This example create a menu and a submenu. The submenu is created first, then the main menu. Special char keys are defined for some options. For better readability, each lines of the items array is for a specific menu item, with title being passed as a pipe parameter. That way, the declaration looks very similar to the end product.</maml:para>
                <maml:para />
                <maml:para />
                <maml:para></maml:para>
            </dev:remarks>
            <command:commandLines>
                <command:commandLine>
                    <command:commandText>
                        <maml:para />
                    </command:commandText>
                </command:commandLine>
            </command:commandLines>
        </command:example>
    </command:examples>
    <maml:relatedLinks>
    </maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<!--Generated by PS Cmdlet Help Editor-->
    <command:details>
        <command:name>New-SimpleMenuItem</command:name>
        <maml:description>
            <maml:para>Create SimpleMenu item</maml:para>
        </maml:description>
        <maml:copyright>
            <maml:para />
        </maml:copyright>
        <command:verb>New</command:verb>
        <command:noun>SimpleMenuItem</command:noun>
        <dev:version />
    </command:details>
    <maml:description>
        <maml:para>Create SImpleMenu item and set custom key, action to be performed and other options. </maml:para>
    </maml:description>
    <command:syntax>
        <command:syntaxItem>
            <maml:name>New-SimpleMenuItem</maml:name>
            <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByValue)" position="0">
                <maml:name>Title</maml:name>
                <maml:description>
                    <maml:para>Display text of menu item.</maml:para>
                </maml:description>
                <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
            </command:parameter>
            <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
                <maml:name>ForegroundColor</maml:name>
                <maml:description>
                    <maml:para>Foreground color of menu item.</maml:para>
                </maml:description>
                <command:parameterValue required="true" variableLength="false">ConsoleColor</command:parameterValue>
            </command:parameter>
            <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
                <maml:name>Id</maml:name>
                <maml:description>
                    <maml:para>ID of menu item. Used to get item and perform changes after creation (optional)</maml:para>
                </maml:description>
                <command:parameterValue required="true" variableLength="false">Object</command:parameterValue>
            </command:parameter>
            <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
                <maml:name>Key</maml:name>
                <maml:description>
                    <maml:para>Letter character associated to the menu item. If none defined, a number will be assigned to the item instead.</maml:para>
                </maml:description>
                <command:parameterValue required="true" variableLength="false">Object</command:parameterValue>
            </command:parameter>
            <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
                <maml:name>Action</maml:name>
                <maml:description>
                    <maml:para>Scriptblock to be invoked when menu item is selected. </maml:para>
                </maml:description>
                <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue>
            </command:parameter>
            <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
                <maml:name>Quit</maml:name>
                <maml:description>
                    <maml:para>If defined, choosing this menu item will exit the current menu. If the current menu is a submenu, this will bring back to parent menu,</maml:para>
                </maml:description>
                <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
            </command:parameter>
            <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
                <maml:name>NoPause</maml:name>
                <maml:description>
                    <maml:para>If this switch is set, menu won&#39;t pause after executing the chosen action.
</maml:para>
                </maml:description>
                <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
            </command:parameter>
            <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
                <maml:name>Submenu</maml:name>
                <maml:description>
                    <maml:para>Set this menu item to open a submenu as action.</maml:para>
                </maml:description>
                <command:parameterValue required="true" variableLength="false">Object</command:parameterValue>
            </command:parameter>
        </command:syntaxItem>
    </command:syntax>
    <command:parameters>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByValue)" position="0">
            <maml:name>Title</maml:name>
            <maml:description>
                <maml:para>Display text of menu item.</maml:para>
            </maml:description>
            <command:parameterValue required="true" variableLength="false">String</command:parameterValue>
            <dev:type>
                <maml:name>String</maml:name>
                <maml:uri/>
            </dev:type>
            <dev:defaultValue></dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
            <maml:name>ForegroundColor</maml:name>
            <maml:description>
                <maml:para>Foreground color of menu item.</maml:para>
            </maml:description>
            <command:parameterValue required="true" variableLength="false">ConsoleColor</command:parameterValue>
            <dev:type>
                <maml:name>ConsoleColor</maml:name>
                <maml:uri/>
            </dev:type>
            <dev:defaultValue></dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
            <maml:name>Id</maml:name>
            <maml:description>
                <maml:para>ID of menu item. Used to get item and perform changes after creation (optional)</maml:para>
            </maml:description>
            <command:parameterValue required="true" variableLength="false">Object</command:parameterValue>
            <dev:type>
                <maml:name>Object</maml:name>
                <maml:uri/>
            </dev:type>
            <dev:defaultValue></dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
            <maml:name>Key</maml:name>
            <maml:description>
                <maml:para>Letter character associated to the menu item. If none defined, a number will be assigned to the item instead.</maml:para>
            </maml:description>
            <command:parameterValue required="true" variableLength="false">Object</command:parameterValue>
            <dev:type>
                <maml:name>Object</maml:name>
                <maml:uri/>
            </dev:type>
            <dev:defaultValue></dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
            <maml:name>Action</maml:name>
            <maml:description>
                <maml:para>Scriptblock to be invoked when menu item is selected. </maml:para>
            </maml:description>
            <command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue>
            <dev:type>
                <maml:name>ScriptBlock</maml:name>
                <maml:uri/>
            </dev:type>
            <dev:defaultValue></dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
            <maml:name>Quit</maml:name>
            <maml:description>
                <maml:para>If defined, choosing this menu item will exit the current menu. If the current menu is a submenu, this will bring back to parent menu,</maml:para>
            </maml:description>
            <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
            <dev:type>
                <maml:name>SwitchParameter</maml:name>
                <maml:uri/>
            </dev:type>
            <dev:defaultValue></dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
            <maml:name>NoPause</maml:name>
            <maml:description>
                <maml:para>If this switch is set, menu won&#39;t pause after executing the chosen action.
</maml:para>
            </maml:description>
            <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
            <dev:type>
                <maml:name>SwitchParameter</maml:name>
                <maml:uri/>
            </dev:type>
            <dev:defaultValue></dev:defaultValue>
        </command:parameter>
        <command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
            <maml:name>Submenu</maml:name>
            <maml:description>
                <maml:para>Set this menu item to open a submenu as action.</maml:para>
            </maml:description>
            <command:parameterValue required="true" variableLength="false">Object</command:parameterValue>
            <dev:type>
                <maml:name>Object</maml:name>
                <maml:uri/>
            </dev:type>
            <dev:defaultValue></dev:defaultValue>
        </command:parameter>
    </command:parameters>
    <command:inputTypes>
        <command:inputType>
            <dev:type>
                <maml:name></maml:name>
                <maml:uri></maml:uri>
                <maml:description/>
            </dev:type>
            <maml:description>
<maml:para />
            </maml:description>
        </command:inputType>
    </command:inputTypes>
    <command:returnValues>
        <command:returnValue>
            <dev:type>
                <maml:name></maml:name>
                <maml:uri></maml:uri>
                <maml:description/>
            </dev:type>
            <maml:description>
<maml:para />
            </maml:description>
        </command:returnValue>
    </command:returnValues>
    <command:terminatingErrors></command:terminatingErrors>
    <command:nonTerminatingErrors></command:nonTerminatingErrors>
    <maml:alertSet>
        <maml:title></maml:title>
        <maml:alert>
            <maml:para />
        </maml:alert>
    </maml:alertSet>
    <command:examples>
    </command:examples>
    <maml:relatedLinks>
    </maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<!--Generated by PS Cmdlet Help Editor-->
    <command:details>
        <command:name>set-SimpleMenuItem</command:name>
        <maml:description>
            <maml:para />
        </maml:description>
        <maml:copyright>
            <maml:para />
        </maml:copyright>
        <command:verb>set</command:verb>
        <command:noun>SimpleMenuItem</command:noun>
        <dev:version />
    </command:details>
    <maml:description>
        <maml:para />
    </maml:description>
    <command:syntax>
        <command:syntaxItem>
            <maml:name>set-SimpleMenuItem</maml:name>
        </command:syntaxItem>
    </command:syntax>
    <command:parameters> </command:parameters>
    <command:inputTypes>
        <command:inputType>
            <dev:type>
                <maml:name></maml:name>
                <maml:uri></maml:uri>
                <maml:description/>
            </dev:type>
            <maml:description>
<maml:para />
            </maml:description>
        </command:inputType>
    </command:inputTypes>
    <command:returnValues>
        <command:returnValue>
            <dev:type>
                <maml:name></maml:name>
                <maml:uri></maml:uri>
                <maml:description/>
            </dev:type>
            <maml:description>
<maml:para />
            </maml:description>
        </command:returnValue>
    </command:returnValues>
    <command:terminatingErrors></command:terminatingErrors>
    <command:nonTerminatingErrors></command:nonTerminatingErrors>
    <maml:alertSet>
        <maml:title></maml:title>
        <maml:alert>
            <maml:para />
        </maml:alert>
    </maml:alertSet>
    <command:examples>
    </command:examples>
    <maml:relatedLinks>
    </maml:relatedLinks>
</command:command>
</helpItems>