cliMenu icon indicating copy to clipboard operation
cliMenu copied to clipboard

Overwrite menus

Open johnwc opened this issue 7 years ago • 1 comments

If I run the script once, then edit the script by adding another menu item. It doesn't show up until I close PowerShell and re-open and run the script from a clean PowerShell.

Is there something that can be done so that if a new script is run it clears all the menus out, that or either when show menu exits it clears all the menus.

johnwc avatar Mar 12 '18 01:03 johnwc

hi, Sorry for the late reply. No need to restart powershell, just unload the module with Remove-Module. Also you should be able to "edit" the menu at runtime. If you have a main-menu, use something like this:

Get-Menu -Name "menuName" | new-menuItem @newMenuItem

Moving forward I think we might need a set-menu cmdlet. I will take it into consideration, thank you.

Cheers

Tore

torgro avatar Mar 13 '18 08:03 torgro