{"id":27233834,"url":"https://github.com/mdgrs-mei/powershellrun","last_synced_at":"2025-04-10T15:20:29.364Z","repository":{"id":224047707,"uuid":"762256272","full_name":"mdgrs-mei/PowerShellRun","owner":"mdgrs-mei","description":"App, Utility and Function Launcher for PowerShell.","archived":false,"fork":false,"pushed_at":"2024-04-13T13:42:01.000Z","size":152,"stargazers_count":127,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-14T12:16:23.168Z","etag":null,"topics":["cli","fuzzy-search","launcher","powershell","terminal","tui"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdgrs-mei.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-23T12:00:34.000Z","updated_at":"2024-04-15T15:15:49.615Z","dependencies_parsed_at":"2024-03-18T15:37:36.054Z","dependency_job_id":"4ec76332-82e1-4598-bcd5-d0b169109fdb","html_url":"https://github.com/mdgrs-mei/PowerShellRun","commit_stats":null,"previous_names":["mdgrs-mei/powershellrun"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdgrs-mei%2FPowerShellRun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdgrs-mei%2FPowerShellRun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdgrs-mei%2FPowerShellRun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdgrs-mei%2FPowerShellRun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdgrs-mei","download_url":"https://codeload.github.com/mdgrs-mei/PowerShellRun/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248243230,"owners_count":21071054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","fuzzy-search","launcher","powershell","terminal","tui"],"created_at":"2025-04-10T15:20:28.633Z","updated_at":"2025-04-10T15:20:29.272Z","avatar_url":"https://github.com/mdgrs-mei.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# PowerShellRun\n\n[![GitHub license](https://img.shields.io/github/license/mdgrs-mei/PowerShellRun)](https://github.com/mdgrs-mei/PowerShellRun/blob/main/LICENSE)\n[![PowerShell Gallery](https://img.shields.io/powershellgallery/p/PowerShellRun)](https://www.powershellgallery.com/packages/PowerShellRun)\n[![PowerShell Gallery](https://img.shields.io/powershellgallery/dt/PowerShellRun)](https://www.powershellgallery.com/packages/PowerShellRun)\n\n[![Pester Test](https://github.com/mdgrs-mei/PowerShellRun/actions/workflows/pester-test.yml/badge.svg)](https://github.com/mdgrs-mei/PowerShellRun/actions/workflows/pester-test.yml)\n\n[![Hashnode](https://img.shields.io/badge/Hashnode-2962FF?style=for-the-badge\u0026logo=hashnode\u0026logoColor=white)](https://mdgrs.hashnode.dev/streamlining-your-workflow-around-the-powershell-terminal)\n\nTerminal Based Launcher and Fuzzy Finder for PowerShell.\n\n![Demo](https://github.com/mdgrs-mei/PowerShellRun/assets/81177095/d133be41-be9b-4045-8fa0-5194220a56fe)\n\n*PowerShellRun* is a PowerShell module that lets you fuzzy search applications, utilities and functions you define and launch them\n with ease. It is a customizable launcher app on the PowerShell terminal.\n\n \u003c/div\u003e\n\n## Installation\n\n```powershell\nInstall-PSResource -Name PowerShellRun\n```\n\n## Requirements\n\n- Windows or macOS\n- PowerShell 7.4 or newer\n\n## Quick Start\n\nFirst, call `Enable-PSRunEntry` to set up entries. You can control which entries are shown by passing the `-Category` parameter. Let's enable all for now:\n\n```powershell\nEnable-PSRunEntry -Category All\n```\n\n`Invoke-PSRun` function opens up the launcher TUI:\n\n```powershell\nInvoke-PSRun\n```\n\n![Invoke-PSRun](https://github.com/mdgrs-mei/PowerShellRun/assets/81177095/f923bc43-c76b-433a-ada1-c2f49fdaba4e)\n\nType characters to search entries and hit `Enter` to launch the selected item. There are some other actions that can be performed depending on the item. Hit `Ctrl+k` to open the Action Window and see what actions are available.\n\n![ActionWindow](https://github.com/mdgrs-mei/PowerShellRun/assets/81177095/7abc7a2b-7252-4fc7-9753-796186fcb2ec)\n\nInstead of typing `Invoke-PSRun` every time, you can assign a shortcut key to quickly launch *PowerShellRun*:\n\n```powershell\nSet-PSRunPSReadLineKeyHandler -InvokePsRunChord 'Ctrl+j'\n```\n\n## Controls\n\nThis is the default key bindings for the major controls. You can customize the bindings through [options](#key-bindings).\n\n| Key | Action |\n| ---- | ---- |\n| `↑`, `↓` | Move cursor. |\n| `PgUp`, `PgDn` | Move cursor up/down one page. |\n| `Enter` | Execute the primary action of the selected entry. |\n| `Tab` | Mark an entry in MultiSelection mode. |\n| `Shift+Tab` | Toggle markers for all entries in MultiSelection mode. |\n| `Backspace` on empty query | Go back to the parent menu. |\n| `Ctrl+R` | Restart the menu. |\n| `Ctrl+K` | Open the Action window. |\n| `Escape` | Quit. |\n\n## PowerShell Profile\n\nThe configurations of *PowerShellRun* are only persistent in a session so you need to add them to your [profile](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles) script to make them set up automatically in every PowerShell session. The typical profile script will look like this:\n\n```powershell\n# profile.ps1\n\n# Set up entries.\nEnable-PSRunEntry -Category All\n\n# Set options.\nSet-PSRunPSReadLineKeyHandler -InvokePsRunChord 'Ctrl+j'\nSet-PSRunDefaultEditorScript -ScriptBlock {\n    param($path)\n    \u0026 code $path\n}\n$option = [PowerSHellRun.SelectorOption]::new()\n$option.KeyBinding.QuitKeys = @(\n    'Escape'\n    'Ctrl+j'\n)\nSet-PSRunDefaultSelectorOption $option\n\n# Add custom entries.\nAdd-PSRunFavoriteFolder -Path 'D:/PowerShellRun' -Icon '✨'\nAdd-PSRunScriptBlock -Name 'GitPullRebase' -ScriptBlock {\n    git pull --rebase --prune\n}\n```\n\n## Entry Categories\n\nThe entries listed in the launcher menu are grouped by `Category` internally. By passing an array of the category names to `Enable-PSRunEntry`, you can control which entries to show:\n\n```powershell\nEnable-PSRunEntry -Category Function, Favorite\n```\n\nIn the following sections, we'll see what categories are available.\n\n### ・🚀 Application\n\nInstalled applications are listed by the `Application` category. You can launch (or launch as admin on Windows) the application by pressing the action key.\n\n### ・🔧 Executable\n\nExecutable files under the PATH are listed by `Executable` category. You can invoke them on the same console where *PowerShellRun* is running.\n\n### ・🔎 Utility\n\nPowerShellRun's built in utilities are listed by `Utility` category.\n\n#### File Manager (PSRun)\n\n`File Manager (PSRun)` navigates the folder hierarchy from the current directory using the PowerShellRun TUI.\n\n![FiileManager](https://github.com/mdgrs-mei/PowerShellRun/assets/81177095/536b0853-0dd2-4c03-b429-c4ec95240cdf)\n\nOn the file entries, there is an action described as `\"Edit with Default Editor\"`. You can customize the script for this action like below:\n\n```powershell\nSet-PSRunDefaultEditorScript -ScriptBlock {\n    param ($path)\n    \u0026 code $path\n}\n```\n\n#### WinGet (PSRun)\n\n`WinGet (PSRun)` helps you install, upgrade and uninstall applications using winget. You need [winget](https://learn.microsoft.com/en-us/windows/package-manager/winget/) and [Microsoft.WinGet.Client](https://github.com/microsoft/winget-cli) module installed to use this utility entry.\n\n![image](https://github.com/mdgrs-mei/PowerShellRun/assets/81177095/225a5e71-cdd7-48ca-ba65-ee0af0dc0dba)\n\n#### PSResourceGet (PSRun)\n\n`PSResourceGet (PSRun)` allows you to install, upgrade and uninstall PowerShell modules. To use this utility, you need [PSResourceGet](https://github.com/PowerShell/PSResourceGet) module which should be pre-installed on PowerShell 7.4.\n\n![image](https://github.com/user-attachments/assets/612af364-5fbe-41a1-b3c3-6250c5853473)\n\n### ・📁 Favorite\n\nYou can register folders or files that you frequently access. The available actions are the same as the ones in `File Manager (PSRun)`.\n\n```powershell\nAdd-PSRunFavoriteFolder -Path 'D:/PowerShellRun'\nAdd-PSRunFavoriteFile -Path 'D:/PowerShellRun/README.md' -Icon '📖' -Preview @\"\n-------------------------------\n💖 This is a custom preview 💖\n-------------------------------\n\"@\n```\n\n![Favarites](https://github.com/mdgrs-mei/PowerShellRun/assets/81177095/d174b169-3c3b-49f3-8d11-1997350c85fc)\n\n### ・📝 Function\n\nThe ability to call PowerShell functions is what makes *PowerShellRun* special. The functions defined between `Start-PSRunFunctionRegistration` and `Stop-PSRunFunctionRegistration` are registered as entries. The scope of the functions needs to be global so that *PowerShellRun* can call them.\n\n```powershell\nStart-PSRunFunctionRegistration\n\n#.SYNOPSIS\n# git pull with rebase option.\nfunction global:GitPullRebase() {\n    git pull --rebase\n}\n# ... Define functions here as many as you want.\n\nStop-PSRunFunctionRegistration\n```\n\n![FunctionBasic](https://github.com/mdgrs-mei/PowerShellRun/assets/81177095/a70e8a1f-5e08-4dd1-861e-8cd74d23c1d2)\n\n`SYNOPSIS` or `DESCRIPTION` in the comment based help is used as a description of the entry. You can also optionally specify parameters using the `COMPONENT`. It uses [ConvertFrom-StringData](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/convertfrom-stringdata?view=powershell-7.4) to extract the parameters.\n\n```powershell\n\u003c#\n.SYNOPSIS\ngit pull with rebase option.\n\n.COMPONENT\nPSRun(\n    Icon = 🌿\n    Preview = This is a custom preview.\\nNew lines need to be written like this.)\n#\u003e\nfunction global:GitPullRebase() {\n    git pull --rebase\n}\n```\n\n![Function](https://github.com/mdgrs-mei/PowerShellRun/assets/81177095/162b90dd-b51a-4b92-ab75-c8c29b3a385d)\n\nIf you cannot add `Start/Stop-PSRunFunctionRegistration` before and after the functions you would like to register, you can use `Add-PSRunFunction` instead to manually add functions one by one. The parameter extraction from the comment based help still works but the parameters passed to `Add-PSRunFunction` take priority. The registered functions must be defined globally before calling `Add-PSRunFunction`.\n\n```powershell\nAdd-PSRunFunction -FunctionName GitPullRebase -Description 'Manually added function'\n```\n\nInside a registered function entry, it's even possible to open *PowerShellRun*'s TUI using the commands described in the following [section](#powershellrun-as-a-generic-selector). To create a pseudo nested menu, we recommend that you enable the `QuitWithBackspaceOnEmptyQuery` flag in the [options](#options) to restore the parent menu with `Backspace` key. `File Manager (PSRun)` is a good example of the nested menu.\n\n```powershell\nfunction global:OpenNestedMenu() {\n    $option = Get-PSRunDefaultSelectorOption\n    $option.QuitWithBackspaceOnEmptyQuery = $true\n\n    $result = Get-ChildItem | ForEach-Object {\n        $entry = [PowerShellRun.SelectorEntry]::new()\n        $entry.UserData = $_\n        $entry.Name = $_.Name\n        $entry\n    } | Invoke-PSRunSelectorCustom -Option $option\n\n    if ($null -eq $result.FocusedEntry) {\n        return\n    }\n    # ... Key handlings here\n}\n```\n\n### ・📘 Script\n\nIf you don't want to use the global scope to define function entries, you can use script entries. `Add-PSRunScriptBlock` adds a ScriptBlock and `Add-PSRunScriptFile` adds a `.ps1` file as an entry. They are invoked by pressing `Enter`.\n\n```powershell\nAdd-PSRunScriptBlock -Name 'Test ScriptBlock' -ScriptBlock {\n    'This is a test ScriptBlock'\n}\n\nAdd-PSRunScriptFile -Path 'D:\\PowerShellRun\\tests\\TestScriptFile.ps1' -Icon '💎'\n```\n\n![image](https://github.com/mdgrs-mei/PowerShellRun/assets/81177095/1fbeb3ee-1bf9-45f2-8729-8ebaa9d18e88)\n\n### ・📂 EntryGroup\n\nEntryGroups can have other entries as their children. You can use them to organize the launcher menu. EntryGroups are created by `Add-PSRunEntryGroup` function, and `Add-PSRun*` functions take `-EntryGroup` parameter to specify the parent group. The following example creates an EntryGroup for `ProjectA` and adds scripts for the project under that group:\n\n```powershell\n$projectA = Add-PSRunEntryGroup -Name 'ProjectA' -Icon '🍎' -PassThru\nAdd-PSRunScriptFile -EntryGroup $projectA -Path 'D:\\PowerShellRun\\Build.ps1' -Icon '🔁'\nAdd-PSRunScriptBlock -EntryGroup $projectA -Name 'Hello' -Icon '👋' -ScriptBlock {\n    'Hello from ProjectA'\n}\n```\n\nIf you add `-Category` parameter to `Add-PSRunEntryGroup`, all the entries that belong to the specified categories are added as children of the group instead of being listed in the top menu.\n\n```powershell\nAdd-PSRunEntryGroup -Name 'Functions' -Category Script, Function\n```\n\n`EntryGroup` forms a nested menu and you can go back to the parent menu by pressing `Backspace` key when the query is empty.\n\n![EntryGroup](https://github.com/user-attachments/assets/14685437-18f1-4363-b3b0-c5061dcc7fed)\n\n## History Search\n\nHistory search functionality is provided outside the *PowerShellRun* menu using PSReadLineKeyHandler. It searches PSReadLine history. Multi-line entries are also supported. You can enable it with the following command:\n\n```powershell\nSet-PSRunPSReadLineKeyHandler -PSReadLineHistoryChord 'Ctrl+r'\n```\n\n![image](https://github.com/mdgrs-mei/PowerShellRun/assets/81177095/350afb04-4862-408b-b6b5-3e3c86d90264)\n\n## Options\n\nYou can customize *PowerShellRun*'s behavior and themes through options. Create a `SelectorOption` instance and pass it to `Set-PSRunDefaultSelectorOption`.\n\n```powershell\n$option = [PowerShellRun.SelectorOption]::new()\n$option.Theme.PromptSymbol = '👉 '\n$option.ActionWindowCycleScrollEnable = $true\nSet-PSRunDefaultSelectorOption $option\nInvoke-PSRun\n```\n\nThe option you set as default can be returned by `Get-PSRunDefaultSelectorOption`. Note that the returned option is always deep cloned. It is useful when you create a nested menu.\n\n```powershell\n$option = Get-PSRunDefaultSelectorOption\n$option.Prompt = 'Nested menu prompt'\n$option.QuitWithBackspaceOnEmptyQuery = $true\n'a', 'b' | Invoke-PSRunSelector -Option $option\n```\n\n### ・Key Bindings\n\nKey bindings are stored in `$option.KeyBinding`. You can set a string of `KeyModifier` and `Key` concatenated with `+` to the key.\n\n```powershell\n$keyBinding = $option.KeyBinding\n$keyBinding.QuitKeys = @(\n    'Escape'\n    'Ctrl+j'\n)\n$keyBinding.MarkerKeys = 'Ctrl+f'\n```\n\n#### Key Remap Mode\n\nThere are two key binding modes, `Normal Mode` and `Key Remap Mode`. You can toggle the remap mode by pressing `RemapModeEnterKeys` and `RemapModeExitKeys`. In Key Remap mode, the keys you specify are remapped to other keys. This is useful if you'd like to achieve something like Vim Normal mode and Insert mode. Vim style `hjkl` navigation is set up like this:\n\n```powershell\n$theme.KeyRemapModeConsoleCursorShape = 'BlinkingBlock'\n$keyBinding.InitialRemapMode = $true\n$keyBinding.EnableTextInputInRemapMode = $false\n$keyBinding.RemapModeEnterKeys = 'Escape'\n$keyBinding.RemapModeExitKeys = 'i'\n$keyBinding.RemapKeys = @(\n    [PowerShellRun.RemapKey]::new('h', 'LeftArrow')\n    [PowerShellRun.RemapKey]::new('j', 'DownArrow')\n    [PowerShellRun.RemapKey]::new('k', 'UpArrow')\n    [PowerShellRun.RemapKey]::new('l', 'RightArrow')\n    [PowerShellRun.RemapKey]::new('Shift+j', 'Shift+DownArrow')\n    [PowerShellRun.RemapKey]::new('Shift+k', 'Shift+UpArrow')\n)\n```\n\nIt starts in Key Remap mode, and `hjkl` keys are remapped to arrow keys. `i` key enables typing, and you can go back to the `hjkl` navigation by `Escape` key.\n\n### ・Theme\n\nThe theme can be customized with `$option.Theme` property. We hope someone creates a cool theme library for *PowerShellRun*🙏.\n\n```powershell\n$default = [PowerShellRun.FontColor]::FromHex('#CBCCC6')\n$gray = [PowerShellRun.FontColor]::FromHex('#707070')\n$highlight = [PowerShellRun.FontColor]::FromHex('#61FFCA')\n$focusHighlight = [PowerShellRun.FontColor]::FromHex('#4CBF99')\n$roundBorder = [PowerShellRun.BorderSymbol]::new()\n$roundBorder.TopLeft = '╭'\n$roundBorder.TopRight = '╮'\n$roundBorder.BottomLeft = '╰'\n$roundBorder.BottomRight = '╯'\n\n$theme = $option.Theme\n$theme.CanvasHeightPercentage = 80\n$theme.Cursor = '▸ '\n$theme.PromptSymbol = ' '\n$theme.IconEnable = $false\n$theme.PreviewPosition = [PowerShellRun.PreviewPosition]::Right\n$theme.CanvasBorderFlags = [PowerShellRun.BorderFlag]::All\n$theme.SearchBarBorderFlags = [PowerShellRun.BorderFlag]::None\n$theme.CanvasBorderSymbol = $roundBorder\n$theme.PreviewBorderSymbol = $roundBorder\n$theme.DefaultForegroundColor = $default\n$theme.CanvasBorderForegroundColor = $gray\n$theme.PromptForegroundColor = $gray\n$theme.PreviewBorderForegroundColor = $gray\n$theme.EntryScrollBarForegroundColor = $gray\n$theme.PreviewScrollBarForegroundColor = $gray\n$theme.CursorForegroundColor = $highlight\n$theme.NameHighlightForegroundColor = $highlight\n$theme.DescriptionHighlightForegroundColor = $highlight\n$theme.NameFocusHighlightBackgroundColor = $focusHighlight\n$theme.DescriptionFocusHighlightBackgroundColor = $focusHighlight\n```\n\n![Theme](https://github.com/mdgrs-mei/PowerShellRun/assets/81177095/3b91109f-2d7e-4985-a85f-67df6e402779)\n\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n# *PowerShellRun* as a Generic Selector\n\n\u003c/div\u003e\n\nThe underlying fuzzy selector in *PowerShellRun* is accessible with the following commands.\n\n## Invoke-PSRunSelector\n\n`Invoke-PSRunSelector` is designed to be used interactively on the terminal. It takes an array of **objects** and returns **objects**. It uses `Name`, `Description` and `Preview` properties of the object by default but you can change them with parameters like `-NameProperty`, `-DescriptionProperty` and `-PreviewProperty`.\n\n```powershell\nGet-ChildItem | Invoke-PSRunSelector -DescriptionProperty FullName -MultiSelection\n```\n\n![SelectorDemo](https://github.com/mdgrs-mei/PowerShellRun/assets/81177095/799397eb-7a31-4349-a4b1-a0e671a4674c)\n\n`-Expression` parameter is useful if you need to build custom strings.\n\n```powershell\nGet-ChildItem | Invoke-PSRunSelector -Expression {@{\n    Name = $_.Name\n    Preview = Get-Item $_ | Out-String\n}}\n```\n\n## Invoke-PSRunSelectorCustom\n\n`Invoke-PSRunSelectorCustom` offers you a full access to the selector and is designed to create your own tool. It takes an array of `SelectorEntry` instances and returns a `SelectorResult` object. A `SelectorResult` object holds information such as the selected entry and the pressed key.\n\n```powershell\nPS\u003e Get-ChildItem | ForEach-Object {\n    $entry = [PowerShellRun.SelectorEntry]::new()\n    $entry.UserData = $_\n    $entry.Name = $_.Name\n    $entry.Preview = $_.FullName\n    $entry\n} | Invoke-PSRunSelectorCustom\n\nFocusedEntry                MarkedEntries KeyCombination Context\n------------                ------------- -------------- -------\nPowerShellRun.SelectorEntry               Enter          PowerShellRun.SelectorContext\n```\n\n### ・PreviewAsyncScript\n\nBy using `PreviewAsyncScript`, it's even possible to show information that takes some time to generate without blocking the UI. If you have [bat](https://github.com/sharkdp/bat) installed for syntax highlighting, you can build a Select-String viewer with this script:\n\n```powershell\n$word = Read-Host 'Type word to search for'\n$filter = Read-Host 'Type path filter (e.g. \"*.cs\")'\n\n$option = [PowerShellRun.SelectorOption]::new()\n$option.Prompt = \"Searching for word '{0}'\" -f $word\n\n$matchLines = Get-ChildItem $filter -Recurse | Select-String $word\n$result = $matchLines | ForEach-Object {\n    $entry = [PowerShellRun.SelectorEntry]::new()\n    $entry.UserData = $_\n    $entry.Name = '{0}:{1}' -f $_.Filename, $_.LineNumber\n    $entry.Description = $_.Path\n    $entry.PreviewAsyncScript = {\n        param($match)\n        \u0026 bat --color=always --highlight-line $match.LineNumber $match.Path\n    }\n    $entry.PreviewAsyncScriptArgumentList = $_\n    $entry.PreviewInitialVerticalScroll = $_.LineNumber\n    $entry\n} | Invoke-PSRunSelectorCustom -Option $option\n\n$match = $result.FocusedEntry.UserData\nif ($match -and ($result.KeyCombination -eq 'Enter')) {\n    $argument = '{0}:{1}' -f $match.Path, $match.LineNumber\n    code --goto $argument\n}\n```\n\n![Invoke-PSRunSelectorCustom](https://github.com/mdgrs-mei/PowerShellRun/assets/81177095/c963be6f-88cb-457b-a966-a94def3f057a)\n\n### ・SearchablePattern\n\nYou can set Regex pattern to `NameSearchablePattern` and `DescriptionSearchablePattern` properties to define which parts of a string are hit by query.\n\n#### Example1: The second word split by space is searchable\n\n```powershell\n# 'bbb' and 'eee' are searchable.\n$pattern = [Regex]::new('(?\u003c=^\\S*\\s).*?(?=\\s|$)')\n'aaa bbb ccc', 'ddd eee fff' | ForEach-Object {\n    $entry = [PowerShellRun.SelectorEntry]::new()\n    $entry.Name = $_\n    $entry.NameSearchablePattern = $pattern\n    $entry\n} | Invoke-PSRunSelectorCustom\n```\n\n#### Example2: All words inside [] are searchable\n\n```powershell\n# 'bbb', 'ccc' and 'ddd' are searchable.\n$pattern = [Regex]::new('(?\u003c=\\[).*?(?=\\])')\n'aaa [bbb] [ccc]', '[ddd] eee fff' | ForEach-Object {\n    $entry = [PowerShellRun.SelectorEntry]::new()\n    $entry.Name = $_\n    $entry.NameSearchablePattern = $pattern\n    $entry\n} | Invoke-PSRunSelectorCustom\n```\n\n## Invoke-PSRunPrompt\n\n`Invoke-PSRunPrompt` can be used to get user input in the same style as `Invoke-PSRunSelectorCustom` but without any entries. It reflects `SelectorOption` and returns the input, `KeyCombination` and the context. `WinGet (PSRun)` is a practical example.\n\n```powershell\nInvoke-PSRunPrompt\n```\n\n![image](https://github.com/mdgrs-mei/PowerShellRun/assets/81177095/90a9537f-afbd-4256-8ebb-af3d8e940d76)\n\n```powershell\nInput KeyCombination Context\n----- -------------- -------\nhello Enter          hello\n```\n\n## Major Limitations\n\n- No history support\n- Some emojis break the rendering\n\n## Changelog\n\nChangelog is available [here](https://github.com/mdgrs-mei/PowerShellRun/blob/main/CHANGELOG.md).\n\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n# Contributing\n\n\u003c/div\u003e\n\n## Code of Conduct\n\nPlease read our [Code of Conduct](https://github.com/mdgrs-mei/PowerShellRun/blob/main/CODE_OF_CONDUCT.md) to foster a welcoming environment. By participating in this project, you are expected to uphold this code.\n\n## Have a question or want to showcase something?\n\nPlease come to our [Discussions](https://github.com/mdgrs-mei/PowerShellRun/discussions) page and avoid filing an issue to ask a question.\n\n## Want to file an issue or make a PR?\n\nPlease see our [Contribution Guidelines](https://github.com/mdgrs-mei/PowerShellRun/blob/main/CONTRIBUTING.md).\n\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n# Credits\n\n\u003c/div\u003e\n\n*PowerShellRun* uses:\n\n- Wcwidth\u003cbr\u003ehttps://github.com/spectreconsole/wcwidth\n\nHeavily inspired by:\n- fzf\u003cbr\u003ehttps://github.com/junegunn/fzf\n- PowerToys Run\u003cbr\u003ehttps://github.com/microsoft/PowerToys\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdgrs-mei%2Fpowershellrun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdgrs-mei%2Fpowershellrun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdgrs-mei%2Fpowershellrun/lists"}