Skip to content

PowerShell Function that generates an interactive and dynamic console menu featuring a list of options, allowing users to navigate and select choices using their keyboard arrows.

License

Notifications You must be signed in to change notification settings

F4Jonatas/InteractiveChoice

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Interactive PS Menu

Description

Generates a dynamic console menu featuring a list of options, allowing users to navigate and select choices using their keyboard arrows.

Show-Menu



Documentation

title : [string/optional]
Title for the menu.
Defaults: "Please make a selection..."

caption: [string/optional]
Menu caption (or title).
Defaults: ""

choices: [array/required]
List of choices to display in the menu.

yselect: [string/optional]
Text to display when the cursor is on the selected option.
Defaults: "🡢"

nselect: [string/optional]
Text to display when the cursor is not on the selected option.
Defaults: " "

default: [int/optional]
Index of the default option selected from the choices.
Don't forget that every array starts counting from zero.
Defaults: 0


Usage

# This example shows how to use the Show-Menu function to display a menu with a custom title and three options.
$choice = show-menu -title "Main Menu" -caption "Select an option." -default 2 -choices (
	"Menu Option 1",
	"Menu Option 2",
	"Menu Option 3"
)

write-host "`nYou chose: $choice`n`n"

About

PowerShell Function that generates an interactive and dynamic console menu featuring a list of options, allowing users to navigate and select choices using their keyboard arrows.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 100.0%