Skip to content

Instantly share code, notes, and snippets.

@neo-sam
Last active June 2, 2021 10:37
Show Gist options
  • Save neo-sam/529c3e91e292ec918a9c8a3920a694ae to your computer and use it in GitHub Desktop.
Save neo-sam/529c3e91e292ec918a9c8a3920a694ae to your computer and use it in GitHub Desktop.
PSFuzzyMenu

REQUIRE FZF in PATH!

after Install-Script PSFuzzyMenu, usage example:

# 1. import the script
. PSFuzzyMenu.ps1

# 2. create a menu object
$menu = [FuzzyMenu]::new()
$menu.header = "My Menu"

# 3. inflate with menu items
$inflater = [FuzzyMenuInflater]::new()
$inflater.AddItem("hello", { 
        Write-Output "hello echo!"
    });
$inflater.AddItem("world", {
        Write-Output "world echo!"
    });
1..20 | % { 
    $id = $_
    $inflater.AddItem("item $id", {
            Write-Output "item($id) echo!"
        }.GetNewClosure());
}
$inflater.inflate($menu);

# call for show
$menu.Show();

CONTACT: email or leave a message.

https://www.powershellgallery.com/packages/PSFuzzyMenu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment