Public/Get-MenuSeparator.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$Separator = [PSCustomObject]@{
    __MarkSeparator = [Guid]::NewGuid()
}

<#
 
.SYNOPSIS
 
Returns a separator for the Show-Menu Cmdlet. The separator is not selectable by the user and
allows a visual distinction of multiple menuitems.
 
.EXAMPLE
 
$MenuItems = @("Option A", "Option B", $(Get-MenuSeparator), "Quit")
Show-Menu $MenuItems
 
#>

function Get-MenuSeparator() {
    [CmdletBinding()]
    Param()

    # Internally we will check this parameter by-reference
    Return $Separator
}