{"id":13704901,"url":"https://github.com/lzybkr/TabExpansionPlusPlus","last_synced_at":"2025-05-05T12:32:34.303Z","repository":{"id":5402206,"uuid":"6591999","full_name":"lzybkr/TabExpansionPlusPlus","owner":"lzybkr","description":"A V3 PowerShell module to improve tab expansion and Intellisense","archived":false,"fork":false,"pushed_at":"2019-01-11T00:24:41.000Z","size":244,"stargazers_count":197,"open_issues_count":15,"forks_count":34,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-04-26T10:55:43.588Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lzybkr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-11-08T06:06:52.000Z","updated_at":"2025-02-15T20:03:59.000Z","dependencies_parsed_at":"2022-07-06T16:03:26.680Z","dependency_job_id":null,"html_url":"https://github.com/lzybkr/TabExpansionPlusPlus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzybkr%2FTabExpansionPlusPlus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzybkr%2FTabExpansionPlusPlus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzybkr%2FTabExpansionPlusPlus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lzybkr%2FTabExpansionPlusPlus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lzybkr","download_url":"https://codeload.github.com/lzybkr/TabExpansionPlusPlus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252497671,"owners_count":21757657,"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":[],"created_at":"2024-08-02T22:00:24.772Z","updated_at":"2025-05-05T12:32:33.945Z","avatar_url":"https://github.com/lzybkr.png","language":"PowerShell","funding_links":[],"categories":["🚀 Productivity","Commandline Productivity","PowerShell"],"sub_categories":[],"readme":"﻿TabExpansionPlusPlus\n====================\n*Important note:* The module was formerly known as TabExpansion++.  It is now TabExpansionPlusPlus.\n\nStarting with PowerShell version 3.0, there is excellent support for tab expansion and Intellisense, but it is missing some useful features. This module addresses some of those shortcomings.\n\nTabExpansionPlusPlus adds support for the following:\n\n* Easily add custom argument completion.\n* Complete attribute argument names, e.g.\n        [CmdletBinding(Def\u003cTAB\u003e\n        -or-\n        [Parameter(\u003cTAB\u003e\n* Exclude hidden files from results.\n* Easily set options like 'IgnoreHiddenShares'.\n\nIn addition to making it simple to add custom argument completion, TabExpansionPlusPlus provides many useful custom argument completers \"out of box\" that can also serve as good examples of how to add your own.\n\nUsage\n-----\nAssuming you've installed the module somewhere in your module path, just import the module in your profile, e.g.:\n\n```powershell\nImport-Module TabExpansionPlusPlus\n```\n\nWhen you import the TabExpansionPlusPlus module, all of the default argument completer functions will be available to you. However, you can create your own argument completer functions to auto-complete parameter values for your own functions.\n\nInstalling\n----------\nIf you have PowerShell V5, or have installed [PowerShellGet](https://www.microsoft.com/en-us/download/details.aspx?id=49186) for V3, you can install right away with:\n\n```powershell\nInstall-Module TabExpansionPlusPlus\n```\n\nAlternatively, you can install in your personal modules folder (e.g. ~\\Documents\\WindowsPowerShell\\Modules), iwith:\n\n```powershell\niex (new-object System.Net.WebClient).DownloadString('https://raw.github.com/lzybkr/TabExpansionPlusPlus/master/Install.ps1')\n```\n\nIf you want to install elsewhere, you can download Install.ps1 (using the URL above) and run it, passing in the directory you want to install.\n\n# Custom Argument Completers\n\n## Create Argument Completer Functions\n\nTo create your own, custom argument completer functions inside a custom module, follow this process:\n\n1. Include a new script file with your module called `\u003cModuleName\u003e.ArgumentCompleters.ps1`\n2. Declare a function inside the script file. This function will be invoked every time that auto-completion is invoked.\n3. The `param()` block must *accept* the following parameters. You do not have to specify the input parameter values, however.\n    - `$commandName` = The name of the PowerShell command that the auto-completer applies to.\n    - `$parameterName` = The name of the PowerShell command parameter that will be auto-completed.\n    - `$wordToComplete` = The partial text that will be auto-completed.\n    - `$commandAst`\n    - `$fakeBoundParameter`\n4. The function **must** return one or more instances of `System.Management.Automation.CompletionResult`. The `New-CompletionResult` command aids with constructing these objects.\n\n```powershell\nfunction VerbCompletion {\n    param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)\n\n    Get-Verb \"$wordToComplete*\" |\n        ForEach-Object {\n            New-CompletionResult -CompletionText $_.Verb -ToolTip (\"Group: \" + $_.Group)\n        }   \n}\n```\n\n## Import Your Argument Completer\n\nAfter you have created a custom argument completer function, the `Register-ArgumentCompleter` command must be used to register your custom argument completer function with the appropriate PowerShell commands/parameters.\n\nThe following parameters should be specified in the call to `Register-ArgumentCompleter`:\n\n- `-Command` = An array of PowerShell command names that share a parameter. You can pass in a static array of command values or dynamically obtain them using `Get-Command` (PowerShell Core) or `Get-CommandWithParameter` (TabExpansionPlusPlus)\n- `-Parameter` = The name of the parameter that the auto-completer function will auto-complete values for.\n- `-Description` = A description of the registered argument completer.\n- `-ScriptBlock` = The PowerShell `ScriptBlock` that will be executed when the argument completer is invoked.\n\n```\nRegister-ArgumentCompleter -CommandName Get-Verb -Parameter Verb -ScriptBlock $function:VerbCompletion -Description 'This argument completer handles the -Verb parameter of the Get-Verb command.'\n```\n\nNote that PowerShell V5 has a cmdlet named `Register-ArgumentCompleter`. This cmdlet is very similar to the function in TabExpansionPlusPlus with two key differences: the V5 cmdlet does not have a -Description parameter, and there is no way to list the registered completers if you use the V5 cmdlet.\n\nModule authors that target V3 and beyond that provide argument completion for their module that works with TabExpansionPlusPlus and/or PowerShell V5 should use the following pattern:\n\n```\nif (Get-Command Register-ArgumentCompleter -ea Ignore)\n{\n    Register-ArgumentCompleter -Command $Command -Parameter $Parameter -ScriptBlock { ... }\n}\n```\n\nThis way, there is no need to override the TabExpansion or TabExpansion2 functions, just suggest that users of your module use PowerShell V5 or TabExpansionPlusPlus.\n\n## Testing Your Argument Completer\n\nAfter you have created your custom argument completer function, and registered it, you should test auto-completion to ensure that the function is working as expected. The TabExpansionPlusPlus module includes a command to aid in this testing called `Test-ArgumentCompleter`.\n\nAt a minimum, you must specify the following parameters to `Test-ArgumentCompleter`:\n\n- `-CommandName` = The name of the command whose argument completer will be tested.\n- `-ParameterName` = The name of the parameter, on the command specified in the `-CommandName` parameter, whose argument completer will be tested.\n\n```powershell\n### Test the argument completer with no input\nTest-ArgumentCompleter -CommandName Get-Verb -ParameterName Verb\n\n### Test the argument completer with input\nTest-ArgumentCompleter -CommandName Get-Verb -ParameterName Verb\n```\n\n# Issues / Feedback\n\nFor any issues or feedback related to this module, please register for GitHub, and post your inquiry to this project's issue tracker.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flzybkr%2FTabExpansionPlusPlus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flzybkr%2FTabExpansionPlusPlus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flzybkr%2FTabExpansionPlusPlus/lists"}