I have created another Powershell module. This time it is about Console Menus you can use to ease the usage for members of your oranization. It is available on GitHub and published to the PowershellGallery. It is called cliMenu.
Puppies
Design goal
- Make it easy to build Menus and change them
- Make it as "declarative" as possible
Menus
Example menu:
Menu options
- Choose the char that creates the outer frame of the menu
- Change the color of the frame
- Change the color and DisplayName for the Menus
- Change the color and Heading for the Menus
- Change the color and Sub-Heading for the Menus
- Change the color and DisplayName for the Menu-Items
- Change the color and footer text for the menus
- Change the Width of the Menu
Menu-Items
Validation and Return value
Any output from the ScriptBlock will be written in the console. As you may know, a ScriptBlock may be a small script or a call to a cmdlet with parameters. I would suggest that you stick to calling custom or built-in cmdlets and design it using the best practice guides from Microsoft in regards to mandatory parameters etc.
Show-Menu
Further you may also invoke a specific Menu-Item in a specific Menu by supplying InvokeItem and MenuId parameters. If the Menu-Item is defined to confirm with the user before invocation, it will prompt the user with a confirmation request before execution. You can override this with the -Force parameter to execute it directly.
Examples
An example with a Main-Menu and Sub-Menu:
Big thank you to Fausto Nascimento for invaluable input and suggestions!
That is it. If you have any questions or issues, look me up on twitter (@toreGroneng) or file an issue on GitHub.
Cheers
Tore
Comments
Post a Comment