chrisseroka / ps-menu Goto Github PK
View Code? Open in Web Editor NEWSimple powershell menu to render interactive console menu
License: MIT License
Simple powershell menu to render interactive console menu
License: MIT License
It might be a good idea to include more documentation and examples on how to setup the menus, minus the .gifs.
This project looks pretty useful.
However, the lack of a license limits its use.
Can you tell which one is it?
Today I can specifically ensure my default field is in the 0 position, but if I'm working with a sorted list that's not great. I want to be able to specify an index value to use as the starting position in the menu.
Potential new improvements.
Add:
..
).Return
2x exits in that current one.After OneGet I was unable to import the module:
PS C:\Users\Sebastiaan> install-module ps-menu -Scope CurrentUser -Force -Verbose
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='ps-menu'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'ps-menu'.
VERBOSE: Performing the operation "Install-Module" on target "Version '1.0.6' of module 'ps-menu'".
VERBOSE: The installation scope is specified to be 'CurrentUser'.
VERBOSE: The specified module will be installed in 'Z:\SkyDrive\Documents\WindowsPowerShell\Modules'.
VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.
VERBOSE: Downloading module 'ps-menu' with version '1.0.6' from the repository
'https://www.powershellgallery.com/api/v2'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='ps-menu'' for ''.
VERBOSE: InstallPackage' - name='ps-menu',
version='1.0.6',destination='C:\Users\Sebastiaan\AppData\Local\Temp\663476229'
VERBOSE: DownloadPackage' - name='ps-menu',
version='1.0.6',destination='C:\Users\Sebastiaan\AppData\Local\Temp\663476229\ps-menu\ps-menu.nupkg',
uri='https://www.powershellgallery.com/api/v2/package/ps-menu/1.0.6'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/ps-menu/1.0.6'.
VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/ps-menu/1.0.6'.
VERBOSE: Completed downloading 'ps-menu'.
VERBOSE: Hash for package 'ps-menu' does not match hash provided from the server.
VERBOSE: InstallPackageLocal' - name='ps-menu',
version='1.0.6',destination='C:\Users\Sebastiaan\AppData\Local\Temp\663476229'
VERBOSE: Catalog file 'ps-menu.cat' is not found in the contents of the module 'ps-menu' being installed.
VERBOSE: Module 'ps-menu' was installed successfully to path
'Z:\SkyDrive\Documents\WindowsPowerShell\Modules\ps-menu\1.0.6'.
PS C:\Users\Sebastiaan> import-module ps-menu
import-module : The specified module 'ps-menu' was not loaded because no valid module file was found in any module dire
ctory.
At line:1 char:1
+ import-module ps-menu
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (ps-menu:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
I need a menu with about 50 entries. Would it be possible to add columns to your menu so we can use the cursor keys to navigate trough the menu? Thanks a lot for your help!
Brgds Deas
When you press Esc to exit a menu, the subsequent prompt doesn't appear below the menu that was just displayed, but seemingly on the line of the statement that originally invoked the menu or some other line above, while leaving lines below intact, making for a confusing visual experience.
Running the 1st example, give the error:
# menu @("option 1", "option 2", "option 3")
> option 1
option 2
option 3
OperationStopped: Index was outside the bounds of the array.
option 1
When adding these functions in a different script, I get the following warning:
WARNING: The names of some imported commands from the module 'load_new_cd' include unapproved verbs
that might make them less discoverable. To find the commands with unapproved verbs,
run the Import-Module command again with the Verbose parameter.
For a list of approved verbs, type Get-Verb.
The trying the example function cdx
, I get the error:
# cd to a directory without any subdirectories:
# cdx
PropertyNotFoundException: The property 'Length' cannot be found on this object.
Verify that the property exists. InvalidOperation: Cannot index into a null array.
# cd ..
# cdx
> C:\Users\xxx\Searches
C:\Users\xxxx\Videos
MethodInvocationException: Exception calling "SetCursorPosition" with "2" argument(s):
"The value must be greater than or equal to zero and less than the console's buffer size
in that dimension. (Parameter 'top') Actual value was 55."
OperationStopped: Index was outside the bounds of the array.
PS. I also added @mklement1's PR fix.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.