Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/QuietusPlus/Write-Menu
PowerShell - A console menu for PowerShell (CLI) - Keyboard navigation + Pages + MultiSelect + Nested Menu's
https://github.com/QuietusPlus/Write-Menu
Last synced: 7 days ago
JSON representation
PowerShell - A console menu for PowerShell (CLI) - Keyboard navigation + Pages + MultiSelect + Nested Menu's
- Host: GitHub
- URL: https://github.com/QuietusPlus/Write-Menu
- Owner: QuietusPlus
- License: mit
- Created: 2016-06-20T15:40:56.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-19T01:49:43.000Z (over 1 year ago)
- Last Synced: 2024-08-02T17:36:45.984Z (3 months ago)
- Language: PowerShell
- Homepage: http://quietusplus.github.io/Write-Menu/
- Size: 366 KB
- Stars: 86
- Watchers: 8
- Forks: 20
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Write-Menu
### -Title 'AppxPackages' -Sort -Entries (Get-AppxPackages).Name
![AppxPackages](Examples/AppxPackages.gif)
### -Title 'AppxPackages' -Sort -MultiSelect -Entries (Get-AppxPackages).Name
![AppxPackages](Examples/MultiSelect.gif)
_NOTE: The menu has been updated multiple times since capturing these screen-grabs, so they are no longer accurate..._
## Description
Outputs a command-line menu which can be navigated using the keyboard.
* Automatically creates multiple pages if the entries cannot fit on-screen.
* Supports nested menus using a combination of hashtables and arrays.
* No entry / page limitations (apart from device performance).
* Sort entries using the -Sort parameter.
* -MultiSelect: Use space to check a selected entry, all checked entries will be invoked / returned upon confirmation.
* Jump to the top / bottom of the page using the Home and End keys.## Parameters
| | Parameter | Example |
|:--|:--|:--|
| Required | Entries (array) | `-Entries @('Entry 1', 'Entry 2', 'Entry 3')` |
| | Entries (hashtable) | `-Entries @{'Entry 1' = 'Write-Host "Command 1"'; 'Entry 2' = 'Write-Host "Command 2"'; 'Entry 3' = 'Write-Host "Command 3'"}` |
| Optional | Title | `-Title 'Example Title'` |
| Optional | Sort | `-Sort` |
| Optional | MultiSelect | `-MultiSelect`## Examples
| Example | Description |
| :-- | :-- |
| [AdvancedMenu](Examples/AdvancedMenu.md) | Demonstrates all supported entry types (regular command + methods of adding a nested menu). |
| [AppxPackages](Examples/AppxPackages.md) | Uses Write-Menu to list app packages (Windows Store/Modern Apps) |
| [CustomMenu](Examples/CustomMenu.md) | Generates a custom menu by manually specifying each entry |## Controls
| Key | Description |
|:--|:--|
| Up | Previous entry |
| Down | Next entry |
| Left / PageUp | Previous page|
| Right / PageDown | Next page |
| Home | Jump to top |
| End | Jump to bottom |
| Space | `-MultiSelect` Select current |
| Insert | `-MultiSelect` Select all |
| Delete | `-MultiSelect` Select none |
| Enter | Confirm selection |
| Esc / Backspace | Exit / Previous menu |