├── .gitignore ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── docs ├── Development │ └── Handlers.md ├── Index.md ├── PowerTab.png ├── ReleaseNotes.md ├── Setup │ ├── ConfigFile.md │ ├── Install.md │ ├── PowerTabConfigLocation.png │ └── TabDatabase.md ├── Usage │ ├── HostSupport.md │ ├── ItemSelectors.md │ ├── PowerTabConsoleList.png │ └── PowerTabIntellisense.png ├── powertab-demo.gif └── ptag │ ├── FeatureList.md │ └── Readme.md ├── modules ├── powertab │ ├── help │ │ ├── Add-TabExpansion.md │ │ ├── Add-TabExpansionComputer.md │ │ ├── Add-TabExpansionType.md │ │ ├── Export-TabExpansionConfig.md │ │ ├── Export-TabExpansionDatabase.md │ │ ├── Export-TabExpansionTheme.md │ │ ├── Find-TabExpansionType.md │ │ ├── Get-TabExpansion.md │ │ ├── Import-TabExpansionConfig.md │ │ ├── Import-TabExpansionDataBase.md │ │ ├── Import-TabExpansionTheme.md │ │ ├── Invoke-TabExpansion.md │ │ ├── Invoke-TabExpansionEditor.md │ │ ├── New-TabExpansionConfig.md │ │ ├── New-TabExpansionDatabase.md │ │ ├── New-TabItem.md │ │ ├── Register-TabExpansion.md │ │ ├── Remove-TabExpansion.md │ │ ├── Remove-TabExpansionComputer.md │ │ ├── Resolve-TabExpansionParameterValue.md │ │ ├── TabExpansion.md │ │ ├── Update-TabExpansionCom.md │ │ ├── Update-TabExpansionDataBase.md │ │ ├── Update-TabExpansionType.md │ │ ├── Update-TabExpansionWmi.md │ │ ├── about_PowerTab.help.txt │ │ ├── about_PowerTab_context.help.txt │ │ ├── about_PowerTab_handlers.help.txt │ │ └── about_PowerTab_usage.help.txt │ ├── psakefile.ps1 │ └── src │ │ ├── ConsoleLib.ps1 │ │ ├── PowerTab.psd1 │ │ ├── PowerTab.psm1 │ │ ├── Readline.ps1 │ │ ├── TabExpansion.ps1 │ │ ├── TabExpansionCore.ps1 │ │ ├── TabExpansionCustomLib.ps1 │ │ ├── TabExpansionHandlers.ps1 │ │ ├── TabExpansionLib.ps1 │ │ ├── TabExpansionResources.ps1 │ │ ├── TabExpansionUtil.ps1 │ │ ├── handlers │ │ ├── OpenSSH.ps1 │ │ ├── PSClientManager.ps1 │ │ ├── PlatyPS.ps1 │ │ ├── PowerShellGet.ps1 │ │ ├── Robocopy.ps1 │ │ └── Utilities.ps1 │ │ └── res │ │ ├── ColorThemes │ │ ├── ThemeAdmin.csv │ │ ├── ThemeBlog.csv │ │ ├── ThemeBlue.csv │ │ ├── ThemeCmdBlack.csv │ │ ├── ThemeCmdWhite.csv │ │ ├── ThemeDigital.csv │ │ ├── ThemeDragon.csv │ │ ├── ThemeGray.csv │ │ ├── ThemeGreen.csv │ │ ├── ThemeGreenBs.csv │ │ ├── ThemeHotdogStand.csv │ │ ├── ThemeOriginal.csv │ │ ├── ThemeSpace.csv │ │ └── ThemeWhite.csv │ │ ├── TabExpansion.Format.ps1xml │ │ ├── en-US │ │ └── Resources.psd1 │ │ └── en │ │ └── Resources.psd1 └── powertabargcompleters │ ├── psakefile.ps1 │ ├── src │ ├── PTAG.psd1 │ ├── completers │ │ ├── Native.PowerShell.ps1 │ │ ├── Noun.Alias.ps1 │ │ ├── Noun.Command.ps1 │ │ ├── Noun.ComputerRestore.ps1 │ │ ├── Noun.Counter.ps1 │ │ ├── Noun.Event.ps1 │ │ ├── Noun.EventLog.ps1 │ │ ├── Noun.Help.ps1 │ │ ├── Noun.History.ps1 │ │ ├── Noun.ItemProperty.ps1 │ │ ├── Noun.Job.ps1 │ │ ├── Noun.Module.ps1 │ │ ├── Noun.PSDrive.ps1 │ │ ├── Noun.PSHostProcess.ps1 │ │ ├── Noun.PSSession.ps1 │ │ ├── Noun.PSSessionConfiguration.ps1 │ │ ├── Noun.PSSnapin.ps1 │ │ ├── Noun.Printer.ps1 │ │ ├── Noun.Process.ps1 │ │ ├── Noun.Service.ps1 │ │ ├── Noun.Variable.ps1 │ │ ├── Noun.Version.ps1 │ │ ├── Noun.WinEvent.ps1 │ │ ├── Param.Culture.ps1 │ │ ├── Param.PSEdition.ps1 │ │ ├── Param.PSProvider.ps1 │ │ └── Param.Scope.ps1 │ └── utils │ │ └── Utility.ps1 │ └── test │ ├── Noun.Alias.Tests.ps1 │ ├── Noun.ComputerRestore.Tests.ps1 │ ├── Noun.Counter.Tests.ps1 │ ├── Noun.Event.Tests.ps1 │ ├── Noun.EventLog.Tests.ps1 │ ├── Noun.Help.Tests.ps1 │ ├── Noun.History.Tests.ps1 │ ├── Noun.ItemProperty.Tests.ps1 │ ├── Noun.Job.Tests.ps1 │ ├── Noun.PSDrive.Tests.ps1 │ ├── Noun.PSSession.Tests.ps1 │ ├── Noun.PSSessionConfiguration.Tests.ps1 │ ├── Noun.Printer.Tests.ps1 │ ├── Noun.Process.Tests.ps1 │ ├── Noun.Service.Tests.ps1 │ ├── Noun.Version.Tests.ps1 │ ├── Noun.WinEvent.Tests.ps1 │ ├── Param.Culture.Tests.ps1 │ ├── Param.PSEdition.Tests.ps1 │ ├── Param.Scope.Tests.ps1 │ └── Test-Utility.ps1 └── psakefile.ps1 /.gitignore: -------------------------------------------------------------------------------- 1 | build/* -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2010 Jason Archer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PowerTab 2 | 3 | Powertab is an extension of the PowerShell [tab expansion](http://docs.microsoft.com/en-us/powershell/scripting/core-powershell/console/using-tab-expansion?view=powershell-6) feature. 4 | 5 | ![Example of PowerTab in use.](docs/powertab-demo.gif) 6 | 7 | PowerTab offers enhanced tab expansion for PowerShell. 8 | 9 | **Major Features:** 10 | - **Context Sensitive** - Leverages the PowerShell parser for context appropriate tab expansion. 11 | - **Extensible** - Offers extension points for additional contexts, such as other PowerShell modules or native applications, with [Tab Expansion Handlers](docs/Development/Handlers.md). 12 | - **Supports Many PowerShell Hosts** - Works in any PowerShell host that runs tab expansion. See the [Host Support](docs/Usage/HostSupport.md) page. 13 | - **New Interfaces** - Offers several GUI options for displaying tab expansion options using [Tab Item Selectors](docs/Usage/ItemSelectors.md). 14 | 15 | ## Install 16 | 17 | Inspect 18 | 19 | ```powershell 20 | Save-Module -Name PowerTab -Path 21 | ``` 22 | 23 | Install 24 | 25 | ```powershell 26 | Install-Module -Name PowerTab 27 | ``` 28 | 29 | ## Help Index 30 | 31 | - Setup 32 | - [Installing PowerTab](docs/Setup/Install.md) 33 | - [Configuration File Location](docs/Setup/ConfigFile.md) 34 | - [Tab Expansion Database](docs/Setup/TabDatabase.md) 35 | - User Interface 36 | - [Tab Item Selectors](docs/Usage/ItemSelectors.md) 37 | - [Host Support](docs/Usage/HostSupport.md) 38 | - Development 39 | - [Tab Expansion Handlers](docs/Development/Handlers.md) 40 | -------------------------------------------------------------------------------- /docs/Development/Handlers.md: -------------------------------------------------------------------------------- 1 | # Tab Expansion Handlers 2 | 3 | PowerTab provides a framework to enrich the tab expansion experience in PowerShell. It also provides extension points to add tab expansion support for additional cmdlets, functions and applications that are not already upported by PowerTab. This is done through tab expansion handlers that add logic to PowerTab. 4 | 5 | Tab expansion handlers are given first chance to decide what to do with the command line. Once a handler has signaled that it has decided on the appropriate output, processing halts and the output of that handler is ressented to the user according to their preferences or the limitations of the PowerShell host. 6 | 7 | Order of operation: 8 | 1. Command Handler (for the current command, if it exists) 9 | 1. Parameter Handler (for the current parameter, if it exists) 10 | 1. Enum Handler (internal to PowerTab, handles parameters with enum values) 11 | 1. Core Handler (general PowerTab logic) 12 | 13 | ## Creating a Command Handler 14 | 15 | Command handlers are called when the last word (location of the cursor) will be the value to a parameter of the command that the command handler is registered to. The handler will be given first chance at the user input as well as information on the current context. Because of this, command handlers can override default PowerTab behavior for parameters of the command. 16 | 17 | Command handlers must follow this contract. 18 | 19 | NOTE: This applies to command and parameter handlers 20 | 1. PowerTab **WILL** provide a context object that records what is known bout the current command line, and a couple of reference variables. 21 | 1. If the handler will provide the tab expansion options for the given ontext, it **MUST** set the variable `$TabExpansionHasOutput.Value` to `$true`, even if no results will be produced. This will stop PowerTab from interpreting the context any further. 22 | 1. The handler **MUST** output the options, as strings, to be displayed to the user, or no output at all. 23 | 1. The handler **MAY** set the variable `$QuoteSpaces.Value` to `$false` to prevent PowerTab from quoting output values from the handler that contain spaces. The default is `$true`. 24 | 25 | **Example:** 26 | ```PowerShell 27 | Register-TabExpansion "Get-Service" -Type Command { 28 | param($Context, [ref]$TabExpansionHasOutput, [ref]$QuoteSpaces) # 1: 29 | 30 | $Argument = $Context.Argument 31 | switch -exact ($Context.Parameter) { 32 | 'DisplayName' { 33 | $TabExpansionHasOutput.Value = $true # 2: 34 | Get-Service -DisplayName "*$Argument*" | Select-Object -ExpandProperty DisplayName # 3: 35 | } 36 | 'Name' { 37 | $TabExpansionHasOutput.Value = $true # 2: 38 | Get-Service -Name "$Argument*" | Select-Object -ExpandProperty Name # 3: 39 | } 40 | } 41 | } 42 | ``` 43 | 44 | ## Creating a Parameter Handler 45 | 46 | Parameter handlers are called when the last word (location of the cursor) ill be the value to the parameter that the parameter handler is registered to. This handler will be called for any command, but only if he registered parameter is the current context. 47 | 48 | Parameter handlers must follow this contract. 49 | 50 | NOTE: This applies to command and parameter handlers 51 | 1. PowerTab WILL provide a context object that records what is known about the current command line, and a couple of reference variables. 52 | 1. If the handler **WILL** provide the tab expansion options for the given context, it **MUST** set the variable `$TabExpansionHasOutput.Value` to `$true`, even if no results will be produced. This will stop PowerTab from interpreting the context any further. 53 | 1. The handler **MUST** output the options, as strings, to be displayed to the user, or no output at all. 54 | 1. The handler **MAY** set the variable `$QuoteSpaces.Value` to `$false` to revent PowerTab from quoting output values from the handler that contain spaces. The default is `$true`. 55 | 56 | Example: 57 | ```PowerShell 58 | Register-TabExpansion "PSDrive" -Type Parameter { 59 | param($Argument, [ref]$TabExpansionHasOutput, [ref]$QuoteSpaces) # 1: 60 | 61 | if ($Argument -notlike '^\$') { 62 | $TabExpansionHasOutput.Value = $true # 2: 63 | Get-PSDrive "$Argument*" | Select-Object -ExpandProperty Name # 3: 64 | } 65 | } 66 | ``` 67 | 68 | ## Registering a Handler 69 | 70 | Once the hander's script block is defined, it must be registered with PowerTab. Here is the syntax of the registration command. 71 | 72 | ```PowerShell 73 | Register-TabExpansion [-Name] [-Handler] [-Type ] [-Force] 74 | ``` 75 | 76 | The name of the command or parameter to handle must be entered. There can only be one handler for a command name or parameter name. 77 | 78 | A command name can either be simple like "Get-FooBar" or fully qualified like "MyModule\Get-Foobar". Using the simple name will trigger on any module using that command name. 79 | 80 | A parameter name should only be the real name of the parameter like "ComputerName". Parameter name aliases will be resolved by PowerTab like "cn" or "comp". -------------------------------------------------------------------------------- /docs/Index.md: -------------------------------------------------------------------------------- 1 | # Help Index 2 | 3 | - Setup 4 | - [Installing PowerTab](Setup/Install.md) 5 | - [Configuration File Location](Setup/ConfigFile.md) 6 | - [Tab Expansion Database](Setup/TabDatabase.md) 7 | - User Interface 8 | - [Tab Item Selectors](Usage/ItemSelectors.md) 9 | - [Host Support](Usage/HostSupport.md) 10 | - Development 11 | - [Tab Expansion Handlers](Development/Handlers.md) -------------------------------------------------------------------------------- /docs/PowerTab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonmarcher/PowerTab/0dc5377530c3f146beb91257a6da442c338ebd65/docs/PowerTab.png -------------------------------------------------------------------------------- /docs/ReleaseNotes.md: -------------------------------------------------------------------------------- 1 | # Release Notes 2 | 3 | ## PowerTab 1.0.0 4 | 5 | Features: 6 | 7 | - Some compatibility changes for PowerShell Core 8 | - Removed Intellisense Item Selector 9 | - Console history from PSReadline used if available 10 | - Added support for new parameters 11 | - Workflow names 12 | - Get-Help -Parameter 13 | - *-Event -SourceIdentifier 14 | - Get-Command -Noun 15 | - Receive-Job -Location 16 | - WMI parameters 17 | - New-Object -ArgumentList (display syntax for constructors) 18 | - Parameters of type Bool 19 | - ConvertTo-HTML calculated properties 20 | - Added support for assignments to enum variables 21 | - Added array functions from PowerShell v3.0 22 | - Remove parameters already used for parameter completion 23 | - New History and Trace logs for PowerTab usage 24 | - ConsoleList 25 | - New color theme based on CMD 26 | 27 | Bug Fixes: 28 | 29 | - General compatiblity fixes with latest PowerShell versions 30 | - Fix display issue with TrueType fonts 31 | - Only loaded commands are shown for PowerShell 3.0 and later 32 | - Compatibility fixes with PowerShell Core and non-Windows OSes 33 | - NOTE: This is not fully tested but full compatibility is a goal 34 | - Consistency fixes for behavior compared to default PowerShell tab expansion 35 | - Many small fixes for provider paths 36 | - Get-Command now includes scripts from $env:PATH 37 | - PowerTab now recognizes automatic aliases for Get-* commands 38 | 39 | Detailed list available here: 40 | https://github.com/jasonmarcher/PowerTab/milestone/1?closed=1 41 | 42 | ## PowerTab 0.99.6 43 | 44 | This release includes a number of stability and performance improvements, as well as some new features. Some help topics have been added to the distribution and more help will be added to the wiki. Please provide feedback on the help/documentation in the discussion forum or issue tracker. 45 | 46 | Special thanks to Stephen Mills for his testing efforts and a bunch of fixes submitted. 47 | 48 | Features: 49 | - Import-TabExpansionConfig should upgrade old databases 50 | - Support for implied "System" prefix for types 51 | - Support for -Server parameter (Add Server to Parameters to expand list of Computers). 52 | - Errors from PowerTab are now gathered in $PowerTabError instead of the global $Error (Prevent PowerTab errors from ending up in $Error). 53 | - Added some support for reg.exe. 54 | - Added some (static) support for netsh.exe. Future releases will dynamically support switches and commands for netsh. 55 | - Added a few help topics for usage and creating tab expansion handlers. 56 | 57 | Bug Fixes: 58 | - Add tab expansion for scripts on System Path 59 | - Fixed several quoting issues for paths. 60 | - Files and directories with parens not being quoted 61 | - Quoting incorrectly escaping characters when in single quotes 62 | - Quoting with $ in name works for first attempt, but not second 63 | - Performance improvements in several areas. 64 | - Speed up Update-TabExpansionWmi 65 | - Cache COM object names for better performance 66 | - PowerTab 0.99.5.0 Much Slower than 0.99 Beta 2 (MOW) 67 | - Change how alias is resolved in TabExpansionUtil.ps1 68 | - Doing Import-Module [TAB] twice causes $PowerTabConfig to be $null 69 | - Search for Printer names from more locations 70 | - Changed ConsoleList filtering to filter on beginning of string rather than sub string when filter starts blank (ConsoleList matches list items by substrings). 71 | - Fixed several contexts that did not allow embedded wildcards. 72 | - Tab Expansion with embeded wildcard not working 73 | - Get-WMIObject Win32_Proce*or[TAB] returns both Win32_Processor and Win32_Proce*or 74 | - # History Completion doesn't work with * 75 | - Parse-Manifest Used Before Declared 76 | - Out-DataGridView not working - Typo in TabExpansionUtil.ps1 on line 43 77 | - Fixed some issues with UNC paths. 78 | - New Function Get-ModulePath removes UNC paths from $Env:PSModulePath 79 | - Error when completing Server in UNC Path 80 | - Tab Completion not working for Computers in UNC path if using forward slash // 81 | - Error at startup when localized resource file is missing -------------------------------------------------------------------------------- /docs/Setup/ConfigFile.md: -------------------------------------------------------------------------------- 1 | # Configuration File Location 2 | 3 | The settings that control the behavior of PowerTab are persisted in a configuration file. That path to the configuration file is stored in the ConfigurationPath setting of PowerTab. 4 | 5 | ```PowerShell 6 | $PowerTabConfig.Setup.ConfigurationPath 7 | ``` 8 | 9 | ## Creating a Configuration File 10 | 11 | There are three ways to create a new configuration file for PowerTab. 12 | 13 | 14 | **When Starting PowerTab** 15 | 16 | ![Configuration File Location Question](PowerTabConfigLocation.png) 17 | 18 | The Setup Wizard will help you choose a location to save your configuration file and tab expansion database. The wizard will present several preset choices or allow choosing an arbitrary folder. 19 | 20 | - **Profile Directory** - The directory storing the user's PowerShell profile. 21 | - **Installation Directory** - The installation directory of PowerTab. 22 | - **Application Data Directory** - In the user's roaming Application Data directory, a "PowerTab" folder will be created. 23 | - **Isolated Storage** - Stored in .NET's Isolated Storage, see the Isolated Storage wiki page for more information. 24 | - **Other Directory** - Enter in any valid path to a folder where the configuration file and database should be stored. 25 | 26 | 27 | **Create a new Configuration after Starting PowerTab** 28 | 29 | ```PowerShell 30 | New-TabExpansionConfig 31 | Export-TabExpansionConfig "" 32 | ``` 33 | 34 | Running these two commands will create a fresh collection of settings and export them to the specified path. The path will be saved in `$PowerTabConfig.Setup.ConfigurationPath` if it has not already been set. Also, `$PowerTabConfig.Setup.DatabasePath` will be updated to point to the same folder if not already set. 35 | 36 | 37 | **Create a Copy of the Existing Configuration** 38 | 39 | ```PowerShell 40 | Export-TabExpansionConfig "" 41 | ``` 42 | 43 | Run this command to export the PowerTab settings to the specified path. The path will be saved in `$PowerTabConfig.Setup.ConfigurationPath` if it has not already been set. Also, `$PowerTabConfig.Setup.DatabasePath` will be updated to point to the same folder if not already set. 44 | 45 | ## Using an Existing Configuration File 46 | 47 | PowerTab has two startup modes, with a configuration and without. If no configuration is specified, the Setup Wizard will prompt to run. To load a configuration file, use one of the following options. 48 | 49 | 50 | **When Starting PowerTab** 51 | 52 | ```PowerShell 53 | Import-Module PowerTab -ArgumentList C:\Users\JASON\PowerTabConfig.xml 54 | ``` 55 | 56 | Pass the full path to a configuration file while starting PowerTab. This will load the configuration and associated tab expansion database while not prompt the user. 57 | 58 | 59 | **While Running PowerTab** 60 | 61 | ```PowerShell 62 | Import-TabExpansionConfig C:\Users\JASON\PowerTabConfig.xml 63 | ``` 64 | 65 | Running this command will replace the current configuration with the specified configuration for the current session, but not the associated tab expansion database. However, the **DatabasePath** setting will be updated and a call to `Import-TabExpansionDatabase` with no arguments will import that database. -------------------------------------------------------------------------------- /docs/Setup/Install.md: -------------------------------------------------------------------------------- 1 | # Installing PowerTab 2 | 3 | ## Installing the PowerTab Module 4 | 5 | ### Install from PowerShell Gallery 6 | 7 | Inspect 8 | 9 | ```powershell 10 | PS> Save-Module -Name PowerTab -Path 11 | ``` 12 | 13 | Install 14 | 15 | ```powershell 16 | PS> Install-Module -Name PowerTab 17 | ``` 18 | 19 | ### Install manually 20 | 21 | Before getting started, please download the latest PowerTab version from this site. PowerTab is distributed as a standard PowerShell module in a ZIP package. The following instructions are very similar for other PowerShell modules. 22 | 23 | The first step is to unblock the download package containing PowerTab. This can be done from Windows Explorer by Right-Clicking on **PowerTab-.zip** and selecting **Properties**. Then click on the **Unblock** button near the bottom of the properties dialog. Finally, press **OK**. 24 | 25 | The second step is to extract the PowerTab package using your favorite archiving utility to your PowerShell modules folder. The default location for this is `.\WindowsPowerShell\Modules` (relative to your **Documents** folder). You may instead extract PowerTab to another folder on your `$env:PSModulePath`. 26 | 27 | There should now be a **PowerTab** folder in your modules folder. PowerTab is now installed and ready to be used. 28 | 29 | ## Running PowerTab 30 | 31 | To run PowerTab, open a PowerShell command prompt (or the shell of your favorite PowerShell editor) and run the following. 32 | 33 | ```PowerShell 34 | Import-Module PowerTab 35 | ``` 36 | 37 | With no arguments, PowerTab will offer to run a setup wizard to configure PowerTab. The setup wizard will which will help define a location to save the [PowerTab config file](ConfigFile.md). The config file is required to persist configuration settings for PowerTab, and cached values for .NET type, WMI class and computer name expansion. 38 | 39 | It is not necessary to run the setup wizard or do any additional configuration of PowerTab (though some features will not be available until configured). 40 | 41 | ## Getting Help 42 | 43 | Help for using PowerTab is provided from several sources. 44 | 45 | - The wiki pages on the PowerTab Website. 46 | - The main about topic available from the PowerShell console. 47 | 48 | ```PowerShell 49 | Get-Help about_PowerTab 50 | ``` 51 | 52 | - Find all of the about topics for PowerTab. 53 | 54 | ```PowerShell 55 | Get-Help about_PowerTab* 56 | ``` 57 | 58 | - Find all of the commands available from PowerTab and then view the help for each one. 59 | 60 | ```PowerShell 61 | Get-Command -Module PowerTab 62 | 63 | ## View the help for a specific PowerTab function 64 | Get-Help Update-TabExpansionDatabase 65 | ``` -------------------------------------------------------------------------------- /docs/Setup/PowerTabConfigLocation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonmarcher/PowerTab/0dc5377530c3f146beb91257a6da442c338ebd65/docs/Setup/PowerTabConfigLocation.png -------------------------------------------------------------------------------- /docs/Setup/TabDatabase.md: -------------------------------------------------------------------------------- 1 | # Tab Expansion Database 2 | 3 | The tab expansion database stores items to improve the performance of PowerTab. Looking up some kinds of items can take too long to make it worth using tab expansion, so PowerTab stores those items for quick look ups. Any tab expansion context setup to use the database will only query the database in oder to prevent excessive wait times. The database needs to be persisted to a file for use in future PowerShell sessions, that path is stored in the **DatabasePath** setting of PowerTab. 4 | 5 | ```PowerShell 6 | $PowerTabConfig.Setup.DatabasePath 7 | ``` 8 | 9 | ## Creating a new Database 10 | 11 | There are several ways to create and save a tab expansion database. PowerTab will always guarantee that a tab expansion database is available while running, though it may be empty. The database will only be automatically saved when running the Setup Wizard, or when passing a non-existent path to PowerTab at startup. 12 | 13 | 14 | **When Starting PowerTab** 15 | 16 | The tab expansion database will be created when PowerTab is started without a path to a configuration file, even if you do not run the Setup Wizard. However, the database will not be populated with any items. When running the Setup Wizard, you will be prompted to populated the tab expansion database. The location of the database created by the Setup Wizard will be the same folder as the configuration file, please see the section on [creating a configuration file from the Setup Wizard](ConfigFile.md#creating-a-configuration-file). 17 | 18 | 19 | **Create a new Database after Starting PowerTab** 20 | 21 | ```PowerShell 22 | New-TabExpansionDatabase 23 | Update-TabExpansionDatabase ## optional 24 | Export-TabExpansionDatabase "" 25 | ``` 26 | 27 | The first and last command will create a new database and save it to the specified path. The second command will save a list of the current .NET types, WMI class names, and computer names. You can run that command with the `-Confirm` parameter to be prompted for each of those steps. When exporting the database, the path will be saved in `$PowerTabConfig.Setup.DatabasePath` if it has not already been set. 28 | 29 | 30 | **Create a Copy of the Existing Database** 31 | 32 | ```PowerShell 33 | Export-TabExpansionDatabase "" 34 | ``` 35 | 36 | Run this command to export the tab expansion database to the specified path. The path will be saved in `$PowerTabConfig.Setup.DatabasePath` if it has not already been set. 37 | 38 | ## Using an Existing Database 39 | 40 | PowerTab has two startup modes, with a configuration and without. If no configuration is specified, the Setup Wizard will prompt to run. Each configuration file has an associated (but not necessarily unique) tab expansion database. To load a database, use one of the following options. 41 | 42 | 43 | **When Starting PowerTab** 44 | 45 | ```PowerShell 46 | Import-Module PowerTab -ArgumentList C:\Users\JASON\PowerTabConfig.xml 47 | ``` 48 | 49 | Pass the full path to a configuration file while starting PowerTab. This will load the configuration and associated tab expansion database while not prompt the user. 50 | 51 | 52 | **While Running PowerTab** 53 | 54 | ```PowerShell 55 | Import-TabExpansionDatabase C:\Users\JASON\TabExpansion.xml 56 | ``` 57 | 58 | Running this command will replace the database in use with the requested database. -------------------------------------------------------------------------------- /docs/Usage/HostSupport.md: -------------------------------------------------------------------------------- 1 | # Host Support 2 | 3 | **Important:** The information on this page may be out of date. 4 | 5 | ## PowerTab Support 6 | 7 | Host Name | PowerTab Support | Notes 8 | --------- | ---------------- | ----- 9 | PowerShell.exe | Yes | Works always, if the command line has changed since last pressing TAB. 10 | PowerShell ISE | Yes | Works always, if the command line has changed since last pressing TAB. 11 | PoshConsole | Yes | 12 | PowerShell Plus | Partial | Works when expanding the first word or element of a command line. Built-in intellisense afterward. 13 | PowerGUI (embedded) | No | Only supports built-in intellisense, does not call PowerTab at all. 14 | All Other Hosts | Not Tested | If a PowerShell host invokes the built-in tab expansion function of PowerShell, then PowerTab should work on that host. 15 | 16 | ## Item Selector Support 17 | 18 | Host Name | ConsoleList | Default 19 | --------- | ----------- | ------- 20 | PowerShell.exe | Yes | Yes 21 | PowerShell ISE | | Yes 22 | PoshConsole | | Yes 23 | PowerShell Plus | Yes | Yes 24 | PowerGUI (embedded) | | ??? 25 | All Other Hosts | | Yes -------------------------------------------------------------------------------- /docs/Usage/ItemSelectors.md: -------------------------------------------------------------------------------- 1 | # Tab Item Selectors 2 | 3 | PowerTab offers several options for shorting through the possible values presented by a tab expansion request. The normal way this is done in cmd.exe and PowerShell.exe is to present the first option based on the context after the user presses the TAB key, and then present the next option if the user presses the TAB key again (and the previous with SHIFT-TAB). 4 | 5 | Additional tab item selectors are available in PowerTab that are designed to make it easier to choose from large lists of tab expansion options. 6 | 7 | **Available Selectors** 8 | 9 | There are currently three selectors available that are detailed in the sections below, **ConsoleList** and **Default**. Also, there is the special setting **Dynamic** that will cause PowerTab to choose the best selector for your PowerShell host. This setting allows you to use PowerTab with multiple PowerShell hosts without needing multiple configurations. 10 | 11 | Please refer to the [Host Support](HostSupport.md) page for information on which selectors are supported on each host. 12 | 13 | **Setting the Selector to Use** 14 | 15 | To choose the tab item selector to use in PowerTab, set the **DefaultHandler** setting to an appropriate value. If that tab item selector will not work in the current PowerShell host, PowerTab will quietly use the "Default" tab item selector. The **AlternateHandler** setting will be used for Double Tab (if enabled), and certain other situations, instead of **DefaultHandler**. 16 | 17 | ```PowerShell 18 | $PowerTabConfig.Core.DefaultHandler = "Dynamic" 19 | $PowerTabConfig.Core.AlternateHandler = "Dynamic" 20 | ``` 21 | 22 | ## ConsoleList 23 | 24 | ![ConsoleList](PowerTabConsoleList.png) 25 | 26 | The ConsoleList utilizes the raw console buffer to display a text based user interface to complement tab expansion. This has the advantage of living inside the console, so it will scroll with the rest of the buffer and can be copied as text. 27 | 28 | **Configuring ConsoleList** 29 | 30 | Setting | Values | Default | Function 31 | ------- | ------ | ------- | -------- 32 | $PowerTabConfig.ConsoleList.MinimumListItems | [Int] | 2 | 33 | $PowerTabConfig.ConsoleList.FastScrollItemCount | [Int] | 10 | The number of items to skip during fast-scroll (SHIFT-UP or SHIFT-DOWN) 34 | $PowerTabConfig.ConsoleList.CloseListOnEmptyFilter | $True or $False | $True | 35 | $PowerTabConfig.ConsoleList.VisualStudioTabBehavior | $True or $False | $False | 36 | $PowerTabConfig.ConsoleList.DotComplete | $True or $False | $True | If `$True`, then entering a period will accept the selection and replace the last word on the command line. 37 | $PowerTabConfig.ConsoleList.AutoExpandOnDot | $True or $False | $True | 38 | $PowerTabConfig.ConsoleList.BackSlashComplete | $True or $False | $True | If `$True`, then entering a slash or backslash will accept the selection and replace the last word on the command line. 39 | $PowerTabConfig.ConsoleList.AutoExpandOnBackSlash | $True or $False | $True | 40 | $PowerTabConfig.ConsoleList.SpaceComplete | $True or $False | $True | 41 | $PowerTabConfig.ConsoleList.CustomComplete | $True or $False | $True | 42 | $PowerTabConfig.ConsoleList.CustomCompletionChars | [String] | "]:)" | 43 | 44 | 45 | **Configuring ConsoleList Appearance** 46 | 47 | Setting | Values | Function 48 | ------- | ------ | -------- 49 | $PowerTabConfig.ConsoleList.DoubleBorder | $True or $False | 50 | $PowerTabConfig.ConsoleList.Colors.TextColor | [ConsoleColor] | 51 | $PowerTabConfig.ConsoleList.Colors.BackColor | [ConsoleColor] | 52 | $PowerTabConfig.ConsoleList.Colors.SelectedTextColor | [ConsoleColor] | 53 | $PowerTabConfig.ConsoleList.Colors.SelectedBackColor | [ConsoleColor] | 54 | $PowerTabConfig.ConsoleList.Colors.FilterColor | [ConsoleColor] | 55 | $PowerTabConfig.ConsoleList.Colors.BorderColor | [ConsoleColor] | 56 | $PowerTabConfig.ConsoleList.Colors.BorderTextColor | [ConsoleColor] | 57 | $PowerTabConfig.ConsoleList.Colors.BorderBackColor | [ConsoleColor] | 58 | 59 | 60 | **Key Map for ConsoleList** 61 | 62 | Key | Function | Notes 63 | --- | -------- | ----- 64 | Tab | Move Selection Down | Holding down SHIFT will cause TAB to move the selection up. 65 | Up Arrow | Move Selection Up | Holding down SHIFT will cause up arrow to jump several lines up according to the $PowerTabConfig.ConsoleList.FastScrollItemCount. 66 | Down Arrow | Move Selection Down | Holding down SHIFT will cause down arrow to jump several lines down according to the $PowerTabConfig.ConsoleList.FastScrollItemCount. 67 | Page Up | Move Up One Page | 68 | Page Down | Move Down One Page | 69 | Right Arrow | Add Next Character to Filter | The character is taken from the current selection. 70 | Left Arrow | Remove Last Character from Filter | The BACKSPACE key has the same function. 71 | Period | | See $PowerTabConfig.ConsoleList.DotComplete above. 72 | \ or / | | See $PowerTabConfig.ConsoleList.BackSlashComplete above. 73 | Space | | 74 | Enter | Accept Current Selection | The selection is used to replace the last word on the command line. 75 | Letters or Numbers | Adds to Filter | The filter updates the list of available choices in real time. 76 | 77 | ## Default 78 | 79 | The Default selector will send all tab expansion options directly to the PowerShell host, where it will be presented in a way that the host chooses. 80 | -------------------------------------------------------------------------------- /docs/Usage/PowerTabConsoleList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonmarcher/PowerTab/0dc5377530c3f146beb91257a6da442c338ebd65/docs/Usage/PowerTabConsoleList.png -------------------------------------------------------------------------------- /docs/Usage/PowerTabIntellisense.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonmarcher/PowerTab/0dc5377530c3f146beb91257a6da442c338ebd65/docs/Usage/PowerTabIntellisense.png -------------------------------------------------------------------------------- /docs/powertab-demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonmarcher/PowerTab/0dc5377530c3f146beb91257a6da442c338ebd65/docs/powertab-demo.gif -------------------------------------------------------------------------------- /docs/ptag/Readme.md: -------------------------------------------------------------------------------- 1 | # PowerTab Argument Completers 2 | 3 | PTAG is a library of PowerShell Argument Completers which are used to provide tab expansion logic for cmdlet parameters. 4 | 5 | These completers offer specific suggestions for parameters of many PowerShell cmdlets. The full [feature list](FeatureList.md). 6 | 7 | ## Install 8 | 9 | Inspect 10 | 11 | ```powershell 12 | Save-Module -Name PTAG -Path 13 | ``` 14 | 15 | Install 16 | 17 | ```powershell 18 | Install-Module -Name PTAG 19 | ``` 20 | 21 | ## Help Index 22 | 23 | - [Feature List](FeatureList.md) -------------------------------------------------------------------------------- /modules/powertab/help/Add-TabExpansion.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Add-TabExpansion 9 | 10 | ## SYNOPSIS 11 | Adds an item to the tab expansion database. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Add-TabExpansion [-Filter] [-Text] [[-Type] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | This command is used to add items to the tab expansion database. 21 | 22 | Items for COM objects, .NET types, or WMI objects can not be added using this command. 23 | Please use the specific commands for those items. 24 | 25 | Changes to the database need to be saved using Export-TabExpansionDatabase. 26 | 27 | ## EXAMPLES 28 | 29 | ### EXAMPLE 1 30 | ``` 31 | Add-TabExpansion -Filter "test" -Text "Your first custom tab expansion was a success!" -Type Custom 32 | ``` 33 | 34 | Description 35 | 36 | ----------- 37 | 38 | This example will add a custom pattern that will turn "test^" into the above sentence after pressing the tab key. 39 | 40 | Changes to the database need to be saved using Export-TabExpansionDatabase. 41 | 42 | ## PARAMETERS 43 | 44 | ### -Filter 45 | The text to match against user input. 46 | 47 | ```yaml 48 | Type: String 49 | Parameter Sets: (All) 50 | Aliases: 51 | 52 | Required: True 53 | Position: 1 54 | Default value: None 55 | Accept pipeline input: False 56 | Accept wildcard characters: False 57 | ``` 58 | 59 | ### -Text 60 | The output text to present to the user. 61 | This value is often the same as Filter. 62 | 63 | ```yaml 64 | Type: String 65 | Parameter Sets: (All) 66 | Aliases: 67 | 68 | Required: True 69 | Position: 2 70 | Default value: None 71 | Accept pipeline input: False 72 | Accept wildcard characters: False 73 | ``` 74 | 75 | ### -Type 76 | The specific feature of PowerTab that the item is to be associated with. 77 | 78 | -- Alias: The item defines an alias that does not exist for a PowerShell command or application. 79 | -- Custom: An item for the custom expansion character(^). 80 | -- Computer: The item represents a computer name. 81 | -- Invoke: An item for the invoke character (&). 82 | 83 | Items for COM objects, .NET types, or WMI objects can not be added using this command. 84 | 85 | ```yaml 86 | Type: String 87 | Parameter Sets: (All) 88 | Aliases: 89 | 90 | Required: False 91 | Position: 3 92 | Default value: Custom 93 | Accept pipeline input: False 94 | Accept wildcard characters: False 95 | ``` 96 | 97 | ### CommonParameters 98 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 99 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 100 | 101 | ## INPUTS 102 | 103 | ### None 104 | 105 | ## OUTPUTS 106 | 107 | ### None 108 | 109 | ## NOTES 110 | 111 | ## RELATED LINKS 112 | 113 | [Get-TabExpansion]() 114 | [Remove-TabExpansion]() 115 | -------------------------------------------------------------------------------- /modules/powertab/help/Add-TabExpansionComputer.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Add-TabExpansionComputer 9 | 10 | ## SYNOPSIS 11 | Adds computer names to the tab expansion database. 12 | 13 | ## SYNTAX 14 | 15 | ### Name (Default) 16 | ``` 17 | Add-TabExpansionComputer [-ComputerName] [] 18 | ``` 19 | 20 | ### OU 21 | ``` 22 | Add-TabExpansionComputer [-OU] [] 23 | ``` 24 | 25 | ### NetView 26 | ``` 27 | Add-TabExpansionComputer [-NetView] [] 28 | ``` 29 | 30 | ## DESCRIPTION 31 | This command is used to add computer names to the tab expansion database. 32 | The computer names can then be used to tab expand contexts that use computer names, for example the -ComputerName parameter. 33 | 34 | Changes to the database need to be saved using Export-TabExpansionDatabase. 35 | 36 | ## EXAMPLES 37 | 38 | ### EXAMPLE 1 39 | ``` 40 | Get-Content .\servers.txt | Add-TabExpansionComputer 41 | ``` 42 | 43 | Description 44 | 45 | ----------- 46 | 47 | In this example a list of computer names is stored in the "servers.txt" file. 48 | Then the file is read and the names added to the tab expansion database by piping into this command. 49 | 50 | ### EXAMPLE 2 51 | ``` 52 | Add-TabExpansionComputer -NetView 53 | ``` 54 | 55 | Description 56 | 57 | ----------- 58 | 59 | This example will use "net view" to add a list of computer names to the tab expansion database. 60 | This is the same command used by Update-TabExpansionDatabase 61 | 62 | NOTE: It is strongly suggest to run Remove-TabExpansionComputer before this command to prevent duplicate entries in the tab expansion database. 63 | 64 | ## PARAMETERS 65 | 66 | ### -ComputerName 67 | A computer name to add to the database. 68 | 69 | ```yaml 70 | Type: String 71 | Parameter Sets: Name 72 | Aliases: Name 73 | 74 | Required: True 75 | Position: 1 76 | Default value: None 77 | Accept pipeline input: True (ByPropertyName, ByValue) 78 | Accept wildcard characters: False 79 | ``` 80 | 81 | ### -NetView 82 | Causes this command to gather computer names using "net view". 83 | 84 | ```yaml 85 | Type: SwitchParameter 86 | Parameter Sets: NetView 87 | Aliases: 88 | 89 | Required: False 90 | Position: Named 91 | Default value: None 92 | Accept pipeline input: False 93 | Accept wildcard characters: False 94 | ``` 95 | 96 | ### -OU 97 | Specifies an Organizational Unit (OU) from Active Directory containing computers that should be added to the tab expansion database. 98 | 99 | ```yaml 100 | Type: DirectoryEntry 101 | Parameter Sets: OU 102 | Aliases: 103 | 104 | Required: True 105 | Position: 1 106 | Default value: None 107 | Accept pipeline input: True (ByValue) 108 | Accept wildcard characters: False 109 | ``` 110 | 111 | ### CommonParameters 112 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 113 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 114 | 115 | ## INPUTS 116 | 117 | ### System.DirectoryServices.DirectoryEntry 118 | You can pipe a DirectoryEntry to Add-TabExpansionComputer to store all computer names that are a part of an OU in the tab expansion database. 119 | 120 | ## OUTPUTS 121 | 122 | ### None 123 | 124 | ## NOTES 125 | 126 | ## RELATED LINKS 127 | 128 | [Remove-TabExpansionComputer]() 129 | 130 | -------------------------------------------------------------------------------- /modules/powertab/help/Add-TabExpansionType.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Add-TabExpansionType 9 | 10 | ## SYNOPSIS 11 | Add type names from an Assembly to the tab expansion database. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Add-TabExpansionType [-Assembly] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | This command will add a list of .NET type names that are part of an Assembly to the tab expansion database. 21 | 22 | Changes to the database need to be saved using Export-TabExpansionDatabase. 23 | 24 | ## EXAMPLES 25 | 26 | ### EXAMPLE 1 27 | ``` 28 | Add-Type -Path .\myassembly.dll -PassThru | Select-Object -ExpandProperty Assembly -Unique | Add-TabExpansionType 29 | ``` 30 | 31 | Description 32 | 33 | ----------- 34 | 35 | This example will first load the assembly "myassembly." Then the assembly object is gathered by combining the "-PassThru" parameter of Add-Type with "Select-Object -ExpandProperty" to pipe into Add-TabExpansionType to add the contained types to the tab expansion database. 36 | 37 | ## PARAMETERS 38 | 39 | ### -Assembly 40 | The Assembly object represent a .NET assembly with types to be added to the tab expansion database. 41 | 42 | ```yaml 43 | Type: Assembly 44 | Parameter Sets: (All) 45 | Aliases: 46 | 47 | Required: True 48 | Position: 1 49 | Default value: None 50 | Accept pipeline input: True (ByValue) 51 | Accept wildcard characters: False 52 | ``` 53 | 54 | ### CommonParameters 55 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 56 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 57 | 58 | ## INPUTS 59 | 60 | ### System.Reflection.Assembly 61 | You can pipe an Assembly to Add-TabExpansionType to store all type names from the assembly in the tab expansion database. 62 | 63 | ## OUTPUTS 64 | 65 | ### None 66 | 67 | ## NOTES 68 | 69 | ## RELATED LINKS 70 | 71 | [Update-TabExpansionType]() 72 | [Remove-TabExpansion]() 73 | [Find-TabExpansionType]() 74 | -------------------------------------------------------------------------------- /modules/powertab/help/Export-TabExpansionConfig.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Export-TabExpansionConfig 9 | 10 | ## SYNOPSIS 11 | Saves the current PowerTab configuration to a file. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Export-TabExpansionConfig [[-LiteralPath] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | This command will export the PowerTab configuration settings to a file. 21 | Configuration changes are not automatically saved and must be manually exported. 22 | 23 | By default this command will export to the path specified in $PowerTabConfig.Setup.ConfigurationPath. 24 | 25 | ## EXAMPLES 26 | 27 | ### EXAMPLE 1 28 | ``` 29 | Export-TabExpansionConfig (Join-Path $HOME "Config.xml") 30 | ``` 31 | 32 | Description 33 | 34 | ----------- 35 | 36 | This example will save the PowerTab configuration to an XML file in the home directory of the current user. 37 | 38 | ## PARAMETERS 39 | 40 | ### -LiteralPath 41 | The path to the file to store the PowerTab configuration in. 42 | 43 | The special value "IsolatedStorage" can be specified and PowerTab will safely choose a file unique to the current user. 44 | 45 | ```yaml 46 | Type: String 47 | Parameter Sets: (All) 48 | Aliases: FullName, Path 49 | 50 | Required: False 51 | Position: 1 52 | Default value: $PowerTabConfig.Setup.ConfigurationPath 53 | Accept pipeline input: True (ByPropertyName, ByValue) 54 | Accept wildcard characters: False 55 | ``` 56 | 57 | ### CommonParameters 58 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 59 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 60 | 61 | ## INPUTS 62 | 63 | ### System.String 64 | You can pipe a string that contains a path to Export-TabExpansionConfig. 65 | 66 | ## OUTPUTS 67 | 68 | ### None 69 | 70 | ## NOTES 71 | 72 | ## RELATED LINKS 73 | 74 | [Import-TabExpansionConfig]() 75 | [New-TabExpansionConfig]() 76 | -------------------------------------------------------------------------------- /modules/powertab/help/Export-TabExpansionDatabase.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Export-TabExpansionDatabase 9 | 10 | ## SYNOPSIS 11 | Saves the tab expansion database to a file. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Export-TabExpansionDatabase [[-LiteralPath] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | This command will export the tab expansion database to a file. 21 | Updates to the tab expansion database are not automatically saved and must be manually exported. 22 | 23 | By default this command will export to the path specified in $PowerTabConfig.Setup.DatabasePath. 24 | 25 | ## EXAMPLES 26 | 27 | ### EXAMPLE 1 28 | ``` 29 | Export-TabExpansionDatabase (Join-Path $HOME "database.xml") 30 | ``` 31 | 32 | Description 33 | 34 | ----------- 35 | 36 | This example will save the tab expansion database to an XML file in the home directory of the current user. 37 | 38 | ## PARAMETERS 39 | 40 | ### -LiteralPath 41 | The path to the file to store the tab expansion database in. 42 | 43 | The special value "IsolatedStorage" can be specified and PowerTab will safely choose a file unique to the current user. 44 | 45 | ```yaml 46 | Type: String 47 | Parameter Sets: (All) 48 | Aliases: FullName, Path 49 | 50 | Required: False 51 | Position: 1 52 | Default value: $PowerTabConfig.Setup.DatabasePath 53 | Accept pipeline input: True (ByPropertyName, ByValue) 54 | Accept wildcard characters: False 55 | ``` 56 | 57 | ### CommonParameters 58 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 59 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 60 | 61 | ## INPUTS 62 | 63 | ### System.String 64 | You can pipe a string that contains a path to Export-TabExpansionDatabase. 65 | 66 | ## OUTPUTS 67 | 68 | ### None 69 | 70 | ## NOTES 71 | 72 | ## RELATED LINKS 73 | 74 | [Import-TabExpansionDatabase]() 75 | [New-TabExpansionDatabase]() 76 | [Update-TabExpansionDatabase]() 77 | -------------------------------------------------------------------------------- /modules/powertab/help/Export-TabExpansionTheme.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Export-TabExpansionTheme 9 | 10 | ## SYNOPSIS 11 | Saves the current PowerTab color theme to a file. 12 | 13 | ## SYNTAX 14 | 15 | ### Name (Default) 16 | ``` 17 | Export-TabExpansionTheme [-Name] [] 18 | ``` 19 | 20 | ### LiteralPath 21 | ``` 22 | Export-TabExpansionTheme [-LiteralPath ] [] 23 | ``` 24 | 25 | ## DESCRIPTION 26 | This command can be used to save the current color settings as a named theme for PowerTab, or to a separate file. 27 | Current color settings are stored in the PowerTab configuration settings. 28 | 29 | ## EXAMPLES 30 | 31 | ### EXAMPLE 1 32 | ``` 33 | Export-TabExpansionTheme -Name TheColorsDuke 34 | ``` 35 | 36 | Description 37 | 38 | ----------- 39 | 40 | This example will create a new named color theme. 41 | Themes are stored in files within the install location of PowerTab. 42 | 43 | ## PARAMETERS 44 | 45 | ### -LiteralPath 46 | The path to the file to store the color settings in. 47 | 48 | ```yaml 49 | Type: String 50 | Parameter Sets: LiteralPath 51 | Aliases: FullName, Path 52 | 53 | Required: False 54 | Position: Named 55 | Default value: None 56 | Accept pipeline input: True (ByPropertyName, ByValue) 57 | Accept wildcard characters: False 58 | ``` 59 | 60 | ### -Name 61 | Specifies the name of the theme to save the current color settings to. 62 | Themes can be imported by name. 63 | 64 | ```yaml 65 | Type: String 66 | Parameter Sets: Name 67 | Aliases: 68 | 69 | Required: True 70 | Position: 1 71 | Default value: None 72 | Accept pipeline input: False 73 | Accept wildcard characters: False 74 | ``` 75 | 76 | ### CommonParameters 77 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 78 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 79 | 80 | ## INPUTS 81 | 82 | ### System.String 83 | You can pipe a string that contains a path to Export-TabExpansionTheme. 84 | 85 | ## OUTPUTS 86 | 87 | ### None 88 | 89 | ## NOTES 90 | 91 | ## RELATED LINKS 92 | 93 | [Import-TabExpansionTheme]() 94 | -------------------------------------------------------------------------------- /modules/powertab/help/Find-TabExpansionType.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Find-TabExpansionType 9 | 10 | ## SYNOPSIS 11 | Find a Namespace or Type in the tab expansion database. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Find-TabExpansionType [[-Name] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | This command will search for .NET Namespaces and Types in the tab expansion database. 21 | 22 | Searching for Types works just like tab expansion, thus at least one dot must be specified to include Types in the results. 23 | 24 | ## EXAMPLES 25 | 26 | ### Example 1 27 | ```powershell 28 | PS C:\> Find-TabExpansionType -Name *.MyType 29 | ``` 30 | 31 | Searches for a Type or Namespace that contains "MyType*" 32 | 33 | ## PARAMETERS 34 | 35 | ### -Name 36 | The name pattern to search for, trailing wildcard is not required. 37 | 38 | ```yaml 39 | Type: String 40 | Parameter Sets: (All) 41 | Aliases: 42 | 43 | Required: False 44 | Position: 0 45 | Default value: None 46 | Accept pipeline input: True (ByValue) 47 | Accept wildcard characters: False 48 | ``` 49 | 50 | ### CommonParameters 51 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 52 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 53 | 54 | ## INPUTS 55 | 56 | ### System.String 57 | 58 | 59 | ## OUTPUTS 60 | 61 | ### System.Management.Automation.CompletionResult 62 | 63 | ## NOTES 64 | 65 | ## RELATED LINKS 66 | 67 | [Add-TabExpansionType]() 68 | [Update-TabExpansionType]() 69 | [Remove-TabExpansion]() 70 | -------------------------------------------------------------------------------- /modules/powertab/help/Get-TabExpansion.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Get-TabExpansion 9 | 10 | ## SYNOPSIS 11 | Gets items available in the tab expansion database. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Get-TabExpansion [[-Filter] ] [[-Type] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | This command retrieves items from the currently loaded tab expansion database. 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Get-TabExpansion -Filter System.* -Type Types 27 | ``` 28 | 29 | Description 30 | 31 | ----------- 32 | 33 | This example will return all .NET types under the System namespace from the tab expansion database. 34 | 35 | ## PARAMETERS 36 | 37 | ### -Filter 38 | A pattern to match the filter property of items in the tab expansion database. 39 | 40 | ```yaml 41 | Type: String 42 | Parameter Sets: (All) 43 | Aliases: 44 | 45 | Required: False 46 | Position: 1 47 | Default value: * 48 | Accept pipeline input: False 49 | Accept wildcard characters: True 50 | ``` 51 | 52 | ### -Type 53 | The collection or collections of items to search. 54 | 55 | ```yaml 56 | Type: String 57 | Parameter Sets: (All) 58 | Aliases: 59 | 60 | Required: False 61 | Position: 2 62 | Default value: * 63 | Accept pipeline input: False 64 | Accept wildcard characters: True 65 | ``` 66 | 67 | ### CommonParameters 68 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 69 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 70 | 71 | ## INPUTS 72 | 73 | ### None 74 | 75 | ## OUTPUTS 76 | 77 | ### PowerTab.TabExpansion.Item 78 | 79 | ### PowerTab.TabExpansion.COMItem 80 | 81 | ### PowerTab.TabExpansion.TypeItem 82 | 83 | ### PowerTab.TabExpansion.WMIItem 84 | 85 | ## NOTES 86 | 87 | ## RELATED LINKS 88 | 89 | [Add-TabExpansion]() 90 | [Remove-TabExpansion]() 91 | -------------------------------------------------------------------------------- /modules/powertab/help/Import-TabExpansionConfig.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Import-TabExpansionConfig 9 | 10 | ## SYNOPSIS 11 | Loads the PowerTab configuration from a file. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Import-TabExpansionConfig [[-LiteralPath] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | This command will import the PowerTab configuration settings from a file. 21 | The current onfiguration will be replaced by the contents of the config file. 22 | 23 | By default this command will import from the path specified in $PowerTabConfig.Setup.ConfigurationPath. 24 | 25 | ## EXAMPLES 26 | 27 | ### EXAMPLE 1 28 | ``` 29 | Import-TabExpansionConfig 30 | ``` 31 | 32 | Description 33 | 34 | ----------- 35 | 36 | This example will reset the current configuration to the last saved set of settings from the PowerTab config file. 37 | 38 | ## PARAMETERS 39 | 40 | ### -LiteralPath 41 | The path to the file to load the PowerTab configuration from. 42 | 43 | The special value "IsolatedStorage" can be specified and PowerTab will safely choose a file unique to the current user. 44 | 45 | ```yaml 46 | Type: String 47 | Parameter Sets: (All) 48 | Aliases: FullName, Path 49 | 50 | Required: False 51 | Position: 1 52 | Default value: $PowerTabConfig.Setup.ConfigurationPath 53 | Accept pipeline input: True (ByPropertyName, ByValue) 54 | Accept wildcard characters: False 55 | ``` 56 | 57 | ### CommonParameters 58 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 59 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 60 | 61 | ## INPUTS 62 | 63 | ### System.String 64 | You can pipe a string that contains a path to Import-TabExpansionConfig. 65 | 66 | ## OUTPUTS 67 | 68 | ### None 69 | 70 | ## NOTES 71 | 72 | ## RELATED LINKS 73 | 74 | [Export-TabExpansionConfig]() 75 | [New-TabExpansionConfig]() 76 | -------------------------------------------------------------------------------- /modules/powertab/help/Import-TabExpansionDataBase.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Import-TabExpansionDataBase 9 | 10 | ## SYNOPSIS 11 | Loads the tab expansion database from a file. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Import-TabExpansionDataBase [[-LiteralPath] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | This command will import the tab expansion database from a file. 21 | The current tab expansion database will be replaced by the contents of the specified file. 22 | 23 | By default this command will import from the path specified in $PowerTabConfig.Setup.DatabasePath. 24 | 25 | ## EXAMPLES 26 | 27 | ### EXAMPLE 1 28 | ``` 29 | Import-TabExpansionDataBase IsolatedStorage 30 | ``` 31 | 32 | Description 33 | 34 | ----------- 35 | 36 | This example will load the tab expansion database from a file safely stored in Isolated Storage. 37 | 38 | ## PARAMETERS 39 | 40 | ### -LiteralPath 41 | The path to the file to load the tab expansion database from. 42 | 43 | The special value "IsolatedStorage" can be specified and PowerTab will safely choose a file unique to the current user. 44 | 45 | ```yaml 46 | Type: String 47 | Parameter Sets: (All) 48 | Aliases: FullName, Path 49 | 50 | Required: False 51 | Position: 1 52 | Default value: $PowerTabConfig.Setup.DatabasePath 53 | Accept pipeline input: True (ByPropertyName, ByValue) 54 | Accept wildcard characters: False 55 | ``` 56 | 57 | ### CommonParameters 58 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 59 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 60 | 61 | ## INPUTS 62 | 63 | ### System.String 64 | You can pipe a string that contains a path to Import-TabExpansionDatabase. 65 | 66 | ## OUTPUTS 67 | 68 | ### None 69 | 70 | ## NOTES 71 | 72 | ## RELATED LINKS 73 | 74 | [Export-TabExpansionDataBase]() 75 | [New-TabExpansionDataBase]() 76 | -------------------------------------------------------------------------------- /modules/powertab/help/Import-TabExpansionTheme.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Import-TabExpansionTheme 9 | 10 | ## SYNOPSIS 11 | Loads a PowerTab color theme from a file. 12 | 13 | ## SYNTAX 14 | 15 | ### Name (Default) 16 | ``` 17 | Import-TabExpansionTheme [-Name] [] 18 | ``` 19 | 20 | ### LiteralPath 21 | ``` 22 | Import-TabExpansionTheme [-LiteralPath ] [] 23 | ``` 24 | 25 | ## DESCRIPTION 26 | This command will import color settings from a named theme or from a file. 27 | 28 | ## EXAMPLES 29 | 30 | ### EXAMPLE 1 31 | ``` 32 | Import-TabExpansionTheme -Name Digital 33 | ``` 34 | 35 | Description 36 | 37 | ----------- 38 | 39 | This example will load the color theme named "Digital." Tab expansion of theme names is supported. 40 | 41 | ## PARAMETERS 42 | 43 | ### -LiteralPath 44 | The path to the file to load the color settings from. 45 | 46 | ```yaml 47 | Type: String 48 | Parameter Sets: LiteralPath 49 | Aliases: FullName, Path 50 | 51 | Required: False 52 | Position: Named 53 | Default value: None 54 | Accept pipeline input: True (ByPropertyName, ByValue) 55 | Accept wildcard characters: False 56 | ``` 57 | 58 | ### -Name 59 | Specifies the name of the theme to import color settings from. 60 | 61 | ```yaml 62 | Type: String 63 | Parameter Sets: Name 64 | Aliases: 65 | 66 | Required: True 67 | Position: 1 68 | Default value: None 69 | Accept pipeline input: False 70 | Accept wildcard characters: False 71 | ``` 72 | 73 | ### CommonParameters 74 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 75 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 76 | 77 | ## INPUTS 78 | 79 | ### System.String 80 | You can pipe a string that contains a path to Import-TabExpansionTheme. 81 | 82 | ## OUTPUTS 83 | 84 | ### None 85 | 86 | ## NOTES 87 | 88 | ## RELATED LINKS 89 | 90 | [Export-TabExpansionTheme]() 91 | -------------------------------------------------------------------------------- /modules/powertab/help/Invoke-TabExpansion.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionCore-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Invoke-TabExpansion 9 | 10 | ## SYNOPSIS 11 | Invokes the tab expansion logic of PowerTab. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Invoke-TabExpansion [-Line] [-LastWord] [-ForceList] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | This function should be called just like the built-in TabExpansion() function of PowerShell. 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Invoke-TabExpansion "Get-Process -" "-" 27 | ``` 28 | 29 | Description 30 | 31 | ----------- 32 | 33 | In this example, PowerTab will interpret the query as looking for a parameter name to Get-Process. 34 | 35 | ## PARAMETERS 36 | 37 | ### -ForceList 38 | Forces ConsoleList to display the list control regardless of the value of MinimumListItems. 39 | This is intended for recursive tab expansion support. 40 | 41 | ```yaml 42 | Type: SwitchParameter 43 | Parameter Sets: (All) 44 | Aliases: 45 | 46 | Required: False 47 | Position: Named 48 | Default value: None 49 | Accept pipeline input: False 50 | Accept wildcard characters: False 51 | ``` 52 | 53 | ### -LastWord 54 | Specifies the last word, or the text that should be replaced by tab expansion. 55 | 56 | ```yaml 57 | Type: String 58 | Parameter Sets: (All) 59 | Aliases: 60 | 61 | Required: True 62 | Position: 2 63 | Default value: None 64 | Accept pipeline input: False 65 | Accept wildcard characters: True 66 | ``` 67 | 68 | ### -Line 69 | Specifies the whole command line string. 70 | 71 | ```yaml 72 | Type: String 73 | Parameter Sets: (All) 74 | Aliases: 75 | 76 | Required: True 77 | Position: 1 78 | Default value: None 79 | Accept pipeline input: False 80 | Accept wildcard characters: False 81 | ``` 82 | 83 | ### CommonParameters 84 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 85 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 86 | 87 | ## INPUTS 88 | 89 | ### None 90 | 91 | ## OUTPUTS 92 | 93 | ### System.String 94 | Zero, one or more tab expansion results. 95 | 96 | ## NOTES 97 | 98 | ## RELATED LINKS 99 | 100 | [about_PowerTab]() 101 | -------------------------------------------------------------------------------- /modules/powertab/help/Invoke-TabExpansionEditor.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Invoke-TabExpansionEditor 9 | 10 | ## SYNOPSIS 11 | Opens a user interface for editing the tab expansion database. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Invoke-TabExpansionEditor [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | This command will open a simple interface for editing the tab expansion database. 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Invoke-TabExpansionEditor 27 | ``` 28 | 29 | Description 30 | 31 | ----------- 32 | 33 | Opens an editor for the tab expansion database. 34 | 35 | ## PARAMETERS 36 | 37 | ### CommonParameters 38 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 39 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 40 | 41 | ## INPUTS 42 | 43 | ### None 44 | 45 | ## OUTPUTS 46 | 47 | ### None 48 | 49 | ## NOTES 50 | 51 | ## RELATED LINKS 52 | 53 | [Invoke-TabExpansionEditor]() 54 | -------------------------------------------------------------------------------- /modules/powertab/help/New-TabExpansionConfig.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # New-TabExpansionConfig 9 | 10 | ## SYNOPSIS 11 | Replaces the PowerTab configuration with default values. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | New-TabExpansionConfig [[-LiteralPath] ] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | This command will reset the configuration settings of PowerTab to their default values. 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | New-TabExpansionConfig 27 | ``` 28 | 29 | Description 30 | 31 | ----------- 32 | 33 | This example will reset the PowerTab configuration to defaults. 34 | 35 | ## PARAMETERS 36 | 37 | ### -LiteralPath 38 | Specifies the value for ConfigurationPath, but a file is not created. 39 | 40 | ```yaml 41 | Type: String 42 | Parameter Sets: (All) 43 | Aliases: FullName, Path 44 | 45 | Required: False 46 | Position: 1 47 | Default value: $PowerTabConfig.Setup.ConfigurationPath 48 | Accept pipeline input: True (ByPropertyName, ByValue) 49 | Accept wildcard characters: False 50 | ``` 51 | 52 | ### CommonParameters 53 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 54 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 55 | 56 | ## INPUTS 57 | 58 | ### System.IO.FileInfo 59 | You can pipe a FileInfo object (or any object with a path) to New-TabExpansionConfig. 60 | 61 | ### System.String 62 | You can pipe a string that contains a path to New-TabExpansionConfig. 63 | 64 | ## OUTPUTS 65 | 66 | ### None 67 | 68 | ## NOTES 69 | 70 | ## RELATED LINKS 71 | 72 | [Export-TabExpansionConfig]() 73 | [Import-TabExpansionConfig]() 74 | -------------------------------------------------------------------------------- /modules/powertab/help/New-TabExpansionDatabase.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # New-TabExpansionDatabase 9 | 10 | ## SYNOPSIS 11 | Replaces the tab expansion database with a new clear database. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | New-TabExpansionDatabase [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | This command clean the tab expansion database and refil it with a few default values. 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | New-TabExpansionDatabase 27 | ``` 28 | 29 | Description 30 | 31 | ----------- 32 | 33 | This example will clean the tab expansion database. 34 | 35 | ## PARAMETERS 36 | 37 | ### CommonParameters 38 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 39 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 40 | 41 | ## INPUTS 42 | 43 | ### None 44 | 45 | ## OUTPUTS 46 | 47 | ### None 48 | 49 | ## NOTES 50 | 51 | ## RELATED LINKS 52 | 53 | [Export-TabExpansionDatabase]() 54 | [Import-TabExpansionDatabase]() 55 | [Update-TabExpansionDatabase]() 56 | -------------------------------------------------------------------------------- /modules/powertab/help/New-TabItem.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # New-TabItem 9 | 10 | ## SYNOPSIS 11 | Helper function to create CompletionResult objects. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | New-TabItem [-Value] [[-Text] ] [-Type ] [-ResultType ] 17 | [-ToolTip ] [] 18 | ``` 19 | 20 | ## DESCRIPTION 21 | This command will create CompletionResult objects for use with any tab item selector. 22 | 23 | ## EXAMPLES 24 | 25 | ### Example 1 26 | ```powershell 27 | PS C:\> Get-Process | New-TabItem -Value {$_.Id} -Text {$_.Name} 28 | ``` 29 | 30 | Basic example of how to convert complex objects into tab expansion results. 31 | 32 | ## PARAMETERS 33 | 34 | ### -ResultType 35 | Type of result, can controls icon and format display in GUI item selectors. 36 | 37 | ```yaml 38 | Type: CompletionResultType 39 | Parameter Sets: (All) 40 | Aliases: 41 | Accepted values: Text, History, Command, ProviderItem, ProviderContainer, Property, Method, ParameterName, ParameterValue, Variable, Namespace, Type, Keyword, DynamicKeyword 42 | 43 | Required: False 44 | Position: Named 45 | Default value: None 46 | Accept pipeline input: False 47 | Accept wildcard characters: False 48 | ``` 49 | 50 | ### -Text 51 | User friendly text to display in list of results. 52 | 53 | ```yaml 54 | Type: String 55 | Parameter Sets: (All) 56 | Aliases: 57 | 58 | Required: False 59 | Position: 1 60 | Default value: None 61 | Accept pipeline input: True (ByValue) 62 | Accept wildcard characters: False 63 | ``` 64 | 65 | ### -ToolTip 66 | Tooltip for item, used in GUI based item selectors. 67 | 68 | ```yaml 69 | Type: String 70 | Parameter Sets: (All) 71 | Aliases: 72 | 73 | Required: False 74 | Position: Named 75 | Default value: None 76 | Accept pipeline input: True (ByValue) 77 | Accept wildcard characters: False 78 | ``` 79 | 80 | ### -Type 81 | DEPRECATED. Included only for backward compatibility. Use -ResultType instead. 82 | 83 | ```yaml 84 | Type: String 85 | Parameter Sets: (All) 86 | Aliases: 87 | 88 | Required: False 89 | Position: Named 90 | Default value: None 91 | Accept pipeline input: False 92 | Accept wildcard characters: False 93 | ``` 94 | 95 | ### -Value 96 | The actual value to fulfill tab expansion. 97 | 98 | ```yaml 99 | Type: String 100 | Parameter Sets: (All) 101 | Aliases: 102 | 103 | Required: True 104 | Position: 0 105 | Default value: None 106 | Accept pipeline input: True (ByValue) 107 | Accept wildcard characters: False 108 | ``` 109 | 110 | ### CommonParameters 111 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 112 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 113 | 114 | ## INPUTS 115 | 116 | ### System.String 117 | 118 | 119 | ## OUTPUTS 120 | 121 | ### System.Management.Automation.CompletionResult 122 | 123 | 124 | ## NOTES 125 | 126 | ## RELATED LINKS 127 | -------------------------------------------------------------------------------- /modules/powertab/help/Register-TabExpansion.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Register-TabExpansion 9 | 10 | ## SYNOPSIS 11 | Registers a handler to take part in tab expansion of parameters and parameter values. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Register-TabExpansion [-Name] [-Handler] [-Type ] [-Force] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | This command allows for the creation of handlers that extend PowerTab to support unique command or parameter usage. 21 | 22 | ## EXAMPLES 23 | 24 | ### EXAMPLE 1 25 | ``` 26 | Register-TabExpansion "Get-Service" -Type Command { 27 | param($Context, [ref]$TabExpansionHasOutput, [ref]$QuoteSpaces) 28 | 29 | $Argument = $Context.Argument 30 | switch -exact ($Context.Parameter) { 31 | 'DisplayName' { 32 | $TabExpansionHasOutput.Value = $true 33 | Get-Service -DisplayName "*$Argument*" | 34 | Select-Object -ExpandProperty DisplayName 35 | } 36 | 'Name' { 37 | $TabExpansionHasOutput.Value = $true 38 | Get-Service -Name "$Argument*" | 39 | Select-Object -ExpandProperty Name 40 | } 41 | } 42 | } 43 | ``` 44 | 45 | Description 46 | 47 | ----------- 48 | 49 | This example is simplified from the Get-Service handler in PowerTab. 50 | Please read about_PowerTab_handlers for a more indepth explanation. 51 | 52 | ## PARAMETERS 53 | 54 | ### -Force 55 | Register the new handler even if a similar handler already exists. 56 | 57 | ```yaml 58 | Type: SwitchParameter 59 | Parameter Sets: (All) 60 | Aliases: 61 | 62 | Required: False 63 | Position: Named 64 | Default value: None 65 | Accept pipeline input: False 66 | Accept wildcard characters: False 67 | ``` 68 | 69 | ### -Handler 70 | A ScriptBlock defining the body of the handler. 71 | 72 | ```yaml 73 | Type: ScriptBlock 74 | Parameter Sets: (All) 75 | Aliases: 76 | 77 | Required: True 78 | Position: 2 79 | Default value: None 80 | Accept pipeline input: True (ByPropertyName) 81 | Accept wildcard characters: False 82 | ``` 83 | 84 | ### -Name 85 | The name of the command or parameter that the handler will target. 86 | 87 | ```yaml 88 | Type: String 89 | Parameter Sets: (All) 90 | Aliases: 91 | 92 | Required: True 93 | Position: 1 94 | Default value: None 95 | Accept pipeline input: True (ByPropertyName) 96 | Accept wildcard characters: False 97 | ``` 98 | 99 | ### -Type 100 | The type of handler to register. 101 | Valid values for Type are: 102 | 103 | -- Command: Handler will have first chance at any expansion involving the registered command. 104 | -- Parameter: Handler will respond to all uses of a parameter not already handled by a Command handler. 105 | -- ParameterName: Special use handler to provide parameter names for non-PowerShell commands. 106 | -- CommandInfo: Special use handler to tell PowerTab about positional parameters and enumeration values. 107 | 108 | ```yaml 109 | Type: String 110 | Parameter Sets: (All) 111 | Aliases: 112 | 113 | Required: False 114 | Position: Named 115 | Default value: Command 116 | Accept pipeline input: False 117 | Accept wildcard characters: False 118 | ``` 119 | 120 | ### CommonParameters 121 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 122 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 123 | 124 | ## INPUTS 125 | 126 | ### System.Collections.Hashtable 127 | You can pipe a hashtable that contains keys named "Name" or "Handler to Register-TabExpansion. 128 | 129 | ## OUTPUTS 130 | 131 | ### None 132 | 133 | ## NOTES 134 | 135 | ## RELATED LINKS 136 | 137 | [about_PowerTab_handlers]() 138 | [about_PowerTab]() 139 | -------------------------------------------------------------------------------- /modules/powertab/help/Remove-TabExpansion.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Remove-TabExpansion 9 | 10 | ## SYNOPSIS 11 | Removes items from the tab expansion database. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Remove-TabExpansion [-Filter] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | This command can remove items from the tab expansion database. 21 | 22 | Changes to the database need to be saved using Export-TabExpansionDatabase. 23 | 24 | ## EXAMPLES 25 | 26 | ### EXAMPLE 1 27 | ``` 28 | Remove-TabExpansion -Filter h 29 | ``` 30 | 31 | Description 32 | 33 | ----------- 34 | 35 | This example will remove some of the custom filters that turn "h^" into calls to Get-Help 36 | 37 | Changes to the database need to be saved using Export-TabExpansionDatabase. 38 | 39 | ## PARAMETERS 40 | 41 | ### -Filter 42 | A pattern to match the Filter property of items from the tab expansion database to be removed. 43 | 44 | ```yaml 45 | Type: String 46 | Parameter Sets: (All) 47 | Aliases: 48 | 49 | Required: True 50 | Position: 1 51 | Default value: None 52 | Accept pipeline input: False 53 | Accept wildcard characters: True 54 | ``` 55 | 56 | ### CommonParameters 57 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 58 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 59 | 60 | ## INPUTS 61 | 62 | ### None 63 | 64 | ## OUTPUTS 65 | 66 | ### None 67 | 68 | ## NOTES 69 | 70 | ## RELATED LINKS 71 | 72 | [Add-TabExpansion]() 73 | [Get-TabExpansion]() 74 | -------------------------------------------------------------------------------- /modules/powertab/help/Remove-TabExpansionComputer.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Remove-TabExpansionComputer 9 | 10 | ## SYNOPSIS 11 | Removes all stored computer names from the tab expansion database. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Remove-TabExpansionComputer [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | This command will remove all computer name entries from the tab expansion database. 21 | 22 | Changes to the database need to be saved using Export-TabExpansionDatabase. 23 | 24 | ## EXAMPLES 25 | 26 | ### EXAMPLE 1 27 | ``` 28 | Remove-TabExpansionComputer 29 | ``` 30 | 31 | Description 32 | 33 | ----------- 34 | 35 | This example will remove all computer name entries from the tab expansion database. 36 | 37 | ## PARAMETERS 38 | 39 | ### CommonParameters 40 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 41 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 42 | 43 | ## INPUTS 44 | 45 | ### None 46 | 47 | ## OUTPUTS 48 | 49 | ### None 50 | 51 | ## NOTES 52 | 53 | ## RELATED LINKS 54 | 55 | [Add-TabExpansionComputer]() 56 | -------------------------------------------------------------------------------- /modules/powertab/help/Resolve-TabExpansionParameterValue.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Resolve-TabExpansionParameterValue 9 | 10 | ## SYNOPSIS 11 | {{Fill in the Synopsis}} 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Resolve-TabExpansionParameterValue [[-Value] ] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | {{Fill in the Description}} 21 | 22 | ## EXAMPLES 23 | 24 | ### Example 1 25 | ```powershell 26 | PS C:\> {{ Add example code here }} 27 | ``` 28 | 29 | {{ Add example description here }} 30 | 31 | ## PARAMETERS 32 | 33 | ### -Value 34 | {{Fill Value Description}} 35 | 36 | ```yaml 37 | Type: String 38 | Parameter Sets: (All) 39 | Aliases: 40 | 41 | Required: False 42 | Position: 0 43 | Default value: None 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ## INPUTS 49 | 50 | ### None 51 | 52 | 53 | ## OUTPUTS 54 | 55 | ### System.Object 56 | 57 | ## NOTES 58 | 59 | ## RELATED LINKS 60 | -------------------------------------------------------------------------------- /modules/powertab/help/TabExpansion.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # TabExpansion 9 | 10 | ## SYNOPSIS 11 | {{Fill in the Synopsis}} 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | TabExpansion [[-Line] ] [[-LastWord] ] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | {{Fill in the Description}} 21 | 22 | ## EXAMPLES 23 | 24 | ### Example 1 25 | ```powershell 26 | PS C:\> {{ Add example code here }} 27 | ``` 28 | 29 | {{ Add example description here }} 30 | 31 | ## PARAMETERS 32 | 33 | ### -LastWord 34 | {{Fill LastWord Description}} 35 | 36 | ```yaml 37 | Type: Object 38 | Parameter Sets: (All) 39 | Aliases: 40 | 41 | Required: False 42 | Position: 1 43 | Default value: None 44 | Accept pipeline input: False 45 | Accept wildcard characters: False 46 | ``` 47 | 48 | ### -Line 49 | {{Fill Line Description}} 50 | 51 | ```yaml 52 | Type: Object 53 | Parameter Sets: (All) 54 | Aliases: 55 | 56 | Required: False 57 | Position: 0 58 | Default value: None 59 | Accept pipeline input: False 60 | Accept wildcard characters: False 61 | ``` 62 | 63 | ## INPUTS 64 | 65 | ### None 66 | 67 | 68 | ## OUTPUTS 69 | 70 | ### System.Object 71 | 72 | ## NOTES 73 | 74 | ## RELATED LINKS 75 | -------------------------------------------------------------------------------- /modules/powertab/help/Update-TabExpansionCom.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Update-TabExpansionCom 9 | 10 | ## SYNOPSIS 11 | Updates the tab expansion database with a fresh list of COM ProgIDs. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Update-TabExpansionCom [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | This command will update the list of ProgIDs for COM objects in the tab expansion database. 21 | 22 | Changes to the database need to be saved using Export-TabExpansionDatabase. 23 | 24 | ## EXAMPLES 25 | 26 | ### EXAMPLE 1 27 | ``` 28 | Update-TabExpansionCom 29 | ``` 30 | 31 | Description 32 | 33 | ----------- 34 | 35 | Updates the list of ProgIDs for COM objects. 36 | 37 | ## PARAMETERS 38 | 39 | ### CommonParameters 40 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 41 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 42 | 43 | ## INPUTS 44 | 45 | ### None 46 | 47 | ## OUTPUTS 48 | 49 | ### None 50 | 51 | ## NOTES 52 | 53 | ## RELATED LINKS 54 | 55 | [Remove-TabExpansion]() 56 | -------------------------------------------------------------------------------- /modules/powertab/help/Update-TabExpansionDataBase.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Update-TabExpansionDataBase 9 | 10 | ## SYNOPSIS 11 | Updates the tab expansion database with fresh lists of items. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Update-TabExpansionDataBase [-Force] [-WhatIf] [-Confirm] [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | This command will update all parts of the tab expansion database. 21 | The database stores source information that takes a long time to gather, such as a list of computer names on the network. 22 | 23 | Changes to the database need to be saved using Export-TabExpansionDatabase. 24 | 25 | ## EXAMPLES 26 | 27 | ### EXAMPLE 1 28 | ``` 29 | Update-TabExpansionDataBase -Confirm 30 | ``` 31 | 32 | Description 33 | 34 | ----------- 35 | 36 | This example will update the tab expansion database, but prompt for each step of the update. 37 | 38 | ## PARAMETERS 39 | 40 | ### -Force 41 | Forces an update of the tab expansion database. 42 | 43 | ```yaml 44 | Type: SwitchParameter 45 | Parameter Sets: (All) 46 | Aliases: 47 | 48 | Required: False 49 | Position: Named 50 | Default value: None 51 | Accept pipeline input: False 52 | Accept wildcard characters: False 53 | ``` 54 | 55 | ### -Confirm 56 | Prompts you for confirmation before running the cmdlet. 57 | 58 | ```yaml 59 | Type: SwitchParameter 60 | Parameter Sets: (All) 61 | Aliases: cf 62 | 63 | Required: False 64 | Position: Named 65 | Default value: None 66 | Accept pipeline input: False 67 | Accept wildcard characters: False 68 | ``` 69 | 70 | ### -WhatIf 71 | Shows what would happen if the cmdlet runs. 72 | The cmdlet is not run. 73 | 74 | ```yaml 75 | Type: SwitchParameter 76 | Parameter Sets: (All) 77 | Aliases: wi 78 | 79 | Required: False 80 | Position: Named 81 | Default value: None 82 | Accept pipeline input: False 83 | Accept wildcard characters: False 84 | ``` 85 | 86 | ### CommonParameters 87 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 88 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 89 | 90 | ## INPUTS 91 | 92 | ### None 93 | 94 | ## OUTPUTS 95 | 96 | ### None 97 | 98 | ## NOTES 99 | 100 | ## RELATED LINKS 101 | 102 | [Export-TabExpansionDataBase]() 103 | [Import-TabExpansionDataBase]() 104 | [New-TabExpansionDataBase]() 105 | -------------------------------------------------------------------------------- /modules/powertab/help/Update-TabExpansionType.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Update-TabExpansionType 9 | 10 | ## SYNOPSIS 11 | Updates the tab expansion database with a fresh list of .NET type names. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Update-TabExpansionType [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | This command will update the list of .NET types in the tab expansion database. 21 | 22 | Changes to the database need to be saved using Export-TabExpansionDatabase. 23 | 24 | ## EXAMPLES 25 | 26 | ### EXAMPLE 1 27 | ``` 28 | Update-TabExpansionType 29 | ``` 30 | 31 | Description 32 | 33 | ----------- 34 | 35 | Updates the list of .NET types. 36 | 37 | ## PARAMETERS 38 | 39 | ### CommonParameters 40 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 41 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 42 | 43 | ## INPUTS 44 | 45 | ### None 46 | 47 | ## OUTPUTS 48 | 49 | ### None 50 | 51 | ## NOTES 52 | 53 | ## RELATED LINKS 54 | 55 | [Add-TabExpansionType]() 56 | [Remove-TabExpansion]() 57 | -------------------------------------------------------------------------------- /modules/powertab/help/Update-TabExpansionWmi.md: -------------------------------------------------------------------------------- 1 | --- 2 | external help file: TabExpansionLib-Help.xml 3 | Module Name: PowerTab 4 | online version: 5 | schema: 2.0.0 6 | --- 7 | 8 | # Update-TabExpansionWmi 9 | 10 | ## SYNOPSIS 11 | Updates the tab expansion database with a fresh list of WMI class names. 12 | 13 | ## SYNTAX 14 | 15 | ``` 16 | Update-TabExpansionWmi [] 17 | ``` 18 | 19 | ## DESCRIPTION 20 | This command will update the list of WMI classes in the tab expansion database. 21 | 22 | Changes to the database need to be saved using Export-TabExpansionDatabase. 23 | 24 | ## EXAMPLES 25 | 26 | ### EXAMPLE 1 27 | ``` 28 | Update-TabExpansionWmi 29 | ``` 30 | 31 | Description 32 | 33 | ----------- 34 | 35 | Updates the list of WMI classes. 36 | 37 | ## PARAMETERS 38 | 39 | ### CommonParameters 40 | This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. 41 | For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). 42 | 43 | ## INPUTS 44 | 45 | ### None 46 | 47 | ## OUTPUTS 48 | 49 | ### None 50 | 51 | ## NOTES 52 | 53 | ## RELATED LINKS 54 | 55 | [Remove-TabExpansion]() 56 | -------------------------------------------------------------------------------- /modules/powertab/help/about_PowerTab.help.txt: -------------------------------------------------------------------------------- 1 | TOPIC 2 | about_PowerTab 3 | 4 | SHORT DESCRIPTION 5 | PowerTab extends the tab expansion feature of PowerShell to offer more 6 | productivity for PowerShell users. 7 | 8 | LONG DESCRIPTION 9 | Tab expansion is a productivity feature of PowerShell similar to 10 | intellisense. Pressing the TAB key will cause PowerTab to suggest full 11 | paths, command names or values based on the current context of the cursor. 12 | 13 | PowerTab offers handling for many common features of PowerShell, such as 14 | parameter names or enum values. PowerTab also contains extension points 15 | for adding specialized tab expansion support for third party applications 16 | and commands. 17 | 18 | 19 | GETTING STARTED 20 | PowerTab is packaged as a PowerShell module and can simply be imported 21 | after being saved to one of the locations of modules in 22 | $env:PSModulePath. 23 | 24 | Import-Module PowerTab 25 | 26 | With no arguments, PowerTab will offer to run the setup wizard which will 27 | help define a location to save the PowerTab config file. The config file 28 | is required to persist configuration settings for PowerTab, and cached 29 | values for .NET type, WMI class and computer name expansion. 30 | 31 | 32 | LOAD POWERTAB WITH AN EXISTING CONFIG 33 | To load an existing config file into PowerTab, pass in the full path to 34 | the config file as the first argument when importing the PowerTab module. 35 | 36 | $Path = "C:\Users\Bob\Documents\WindowsPowerShell\PowerTabConfig.xml" 37 | Import-Module PowerTab -ArgumentList $Path 38 | 39 | 40 | FEEDBACK 41 | Please submit suggestions, bug reports or questions to the PowerTab 42 | website. 43 | 44 | http://powertab.codeplex.com 45 | 46 | 47 | CREDITS 48 | This is a list of people and/or groups who have directly or indirectly 49 | helped by offering significant suggestions, code or linkable binaries. 50 | In no particular order: 51 | 52 | Marc "/\/\o\/\/" van Orsouw, MVP 53 | https://mvp.support.microsoft.com/profile/van%20Orsouw 54 | http://thepowershellguy.com/ 55 | 56 | Jason Archer 57 | 58 | Xaegr 59 | http://xaegr.livejournal.com/ 60 | 61 | Jacques 62 | http://janel.spaces.live.com/blog/ 63 | 64 | Igor Dvorkin 65 | 66 | 67 | SEE ALSO 68 | 69 | about_PowerTab_usage 70 | http://powertab.codeplex.com/documentation 71 | -------------------------------------------------------------------------------- /modules/powertab/help/about_PowerTab_context.help.txt: -------------------------------------------------------------------------------- 1 | TOPIC 2 | about_PowerTab_context 3 | 4 | SHORT DESCRIPTION 5 | Describes how PowerTab understands the context of a tab expansion request. 6 | 7 | LONG DESCRIPTION 8 | [Repurposing this topic.] 9 | 10 | 11 | CONTEXT OBJECT 12 | The context object represents PowerTab's understanding of the current 13 | command line. 14 | 15 | TraceId : 16 | The cross referencing ID to messages in the PowerTab trace log. 17 | 18 | Line : 19 | The full command line. 20 | 21 | LastWord : 22 | The last word, subject of the tab expansion. 23 | 24 | LastToken : 25 | The last token parsed from the command line, may not be a token of 26 | the last word. 27 | 28 | Command : 29 | The name of the command that PowerTab has identified as being the 30 | current context (see isCommandMode). 31 | 32 | Parameter : 33 | The name of the parameter that PowerTab has identified as being the 34 | current context of the last word (see isParameterValue). 35 | 36 | Argument : 37 | The value entered so far for the parameter, typically this is the 38 | last word. 39 | 40 | PositionalParameter : 41 | The index of the last positional parameter. 42 | 43 | PositionalParameters : 44 | The values of all positional parameters entered. 45 | 46 | OtherParameters : 47 | A collection of the other identified parameters to the current 48 | command and their values, from the command line. 49 | 50 | isCommandMode : 51 | Identifies the current context as a command to be run. 52 | 53 | isAssignment : 54 | If the result of the commandline will be assigned to a variable 55 | (reserved for future functionality). 56 | 57 | isParameterValue : 58 | Identifies the current context of the last word as being a value 59 | to a parameter. 60 | 61 | CommandInfo : 62 | Standard PowerShell info object for the identified command. 63 | 64 | 65 | Examples: 66 | 67 | TraceId : 96c69b40-7ea0-4d21-99d5-3ca6c9261595 68 | Line : Get-Process d* -ComputerName 69 | LastWord : 70 | LastToken : CommandParameter 71 | Command : Get-Process 72 | Parameter : ComputerName 73 | Argument : 74 | PositionalParameter : 0 75 | PositionalParameters : {d*} 76 | OtherParameters : {} 77 | isCommandMode : True 78 | isAssignment : False 79 | isParameterValue : True 80 | CommandInfo : Get-Process 81 | 82 | 83 | TraceId : 23e8943b-cc89-4043-905a-6e5c0b5ec200 84 | Line : Get-Process -Name d* -ErrorVariable e 85 | LastWord : e 86 | LastToken : CommandArgument 87 | Command : Get-Process 88 | Parameter : ErrorVariable 89 | Argument : e 90 | PositionalParameter : -1 91 | PositionalParameters : {} 92 | OtherParameters : {Name} 93 | isCommandMode : True 94 | isAssignment : False 95 | isParameterValue : True 96 | CommandInfo : Get-Process 97 | 98 | 99 | SEE ALSO 100 | 101 | http://powertab.codeplex.com/documentation 102 | -------------------------------------------------------------------------------- /modules/powertab/psakefile.ps1: -------------------------------------------------------------------------------- 1 | Properties { 2 | $ModuleName = 'PowerTab' 3 | $RootDirectory = "$PSScriptRoot/../.." 4 | $SrcDirectory = "$PSScriptRoot/src" 5 | $HelpDirectory = "$PSScriptRoot/help" 6 | $OutputDirectory = "$RootDirectory/build/$ModuleName" 7 | $ReportDirectory = "$RootDirectory/build/reports/$ModuleName" 8 | $DeployDirectory = "$HOME/Documents/WindowsPowerShell/Modules/$ModuleName" 9 | } 10 | 11 | Task 'default' -Depends build 12 | 13 | Task 'clean' { 14 | if (Test-Path $OutputDirectory) { 15 | Remove-Item $OutputDirectory -Recurse -Force 16 | } 17 | } 18 | 19 | Task 'buildHelp' { 20 | New-Item $OutputDirectory -ItemType Directory -ErrorAction SilentlyContinue > $null 21 | 22 | New-ExternalHelp -Path $HelpDirectory -OutputPath $OutputDirectory 23 | 24 | ## Copy about topics 25 | Copy-Item "$HelpDirectory/*" -Include "about_*.txt" -Destination $OutputDirectory -Force 26 | } 27 | 28 | Task 'build' -Depends buildHelp { 29 | New-Item $OutputDirectory -ItemType Directory -ErrorAction SilentlyContinue > $null 30 | 31 | ## Copy manifest 32 | Copy-Item "$SrcDirectory/$ModuleName.psd1" -Destination $OutputDirectory -Force 33 | 34 | ## Build module 35 | Copy-Item "$SrcDirectory/$ModuleName.psm1" -Destination $OutputDirectory -Force 36 | Get-ChildItem "$SrcDirectory/*" -Include '*.ps1' -Recurse | Copy-Item -Destination $OutputDirectory -Force 37 | $ModuleContent = @( 38 | '## Reason: Using Write-Host is intentional', 39 | '[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingWriteHost", "")]', 40 | '## Reason: ConsoleList uses variables that are intended to be used in recursive calls', 41 | '[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "")]', 42 | 'param()' 43 | ) 44 | foreach ($script in (Get-ChildItem "$SrcDirectory/*" -Include '*.ps1')) { 45 | $ModuleContent += Get-Content $script.FullName 46 | } 47 | foreach ($script in (Get-ChildItem "$SrcDirectory/handlers" -Include '*.ps1')) { 48 | $ModuleContent += Get-Content $script.FullName 49 | } 50 | $ModuleContent += Get-Content "$SrcDirectory/$ModuleName.psm1" 51 | # Set-Content "$OutputDirectory/$ModuleName.txt" -Value $ModuleContent -Encoding UTF8 -Force 52 | 53 | ## Copy resources 54 | Copy-Item "$SrcDirectory/res/*" -Destination $OutputDirectory -Recurse -Force 55 | } 56 | 57 | Task 'deploy' { 58 | if (Test-Path $DeployDirectory) { 59 | Remove-Item $DeployDirectory -Recurse -Force 60 | } 61 | 62 | New-Item $DeployDirectory -ItemType Directory -ErrorAction SilentlyContinue > $null 63 | 64 | Copy-Item "$OutputDirectory/*" -Destination $DeployDirectory -Recurse -Force 65 | } 66 | 67 | Task 'checkStyle' { 68 | New-Item $ReportDirectory -ItemType Directory -ErrorAction SilentlyContinue > $null 69 | 70 | $FilesToCheck = Get-ChildItem $SrcDirectory -Include *.ps1 -Recurse 71 | $FilesToCheck += Get-ChildItem $OutputDirectory -Include *.psd1 -Recurse 72 | 73 | $Results = $FilesToCheck | ForEach-Object {Invoke-ScriptAnalyzer $_.FullName} 74 | $Results | Where-Object Severity -eq "Error" | Format-Table | Out-String | Write-Host -ForegroundColor Red 75 | $Results | Select-Object RuleName,Severity,Line,Column,ScriptName,Message | ConvertTo-Csv -NoTypeInformation | Set-Content "$ReportDirectory/checkstyle.csv" -Force 76 | } -------------------------------------------------------------------------------- /modules/powertab/src/Readline.ps1: -------------------------------------------------------------------------------- 1 | # Readline.ps1 2 | # 3 | # 4 | 5 | 6 | Function Show-CommonPrefix { 7 | [CmdletBinding()] 8 | param( 9 | [Parameter(Position = 1)] 10 | [ValidateNotNull()] 11 | [String] 12 | $LastWord = '' 13 | , 14 | [Parameter(ValueFromPipeline = $true)] 15 | [ValidateNotNull()] 16 | [Object[]] 17 | $InputObject = @() 18 | ) 19 | 20 | begin { 21 | [Object[]]$Content = @() 22 | } 23 | 24 | process { 25 | $Content += $InputObject 26 | } 27 | 28 | end { 29 | if ($Content.Count -le 1) { 30 | $Content | Select-Object -ExpandProperty Value 31 | } else { 32 | $CommonPrefix = Search-CommonPrefix ($Content | Select-Object -ExpandProperty Value) 33 | 34 | if ($CommonPrefix) { 35 | if ($LastWord -eq $CommonPrefix) { 36 | [System.Console]::Beep() 37 | } 38 | $CommonPrefix 39 | } else { 40 | [System.Console]::Beep() 41 | } 42 | } 43 | } 44 | } 45 | 46 | 47 | Function Search-CommonPrefix { 48 | [CmdletBinding()] 49 | [OutputType([String])] 50 | param( 51 | [Parameter()] 52 | [ValidateNotNull()] 53 | [String[]] 54 | $Strings = @() 55 | ) 56 | 57 | end { 58 | if ($Strings.Count -eq 0) { 59 | return "" 60 | } 61 | if ($Strings.Count -eq 1) { 62 | return $Strings[0] 63 | } 64 | 65 | $PrefixLength = 0 66 | 67 | :outerloop foreach ($Character in $Strings[0].ToCharArray()) { 68 | foreach ($String in $Strings) { 69 | if (($String.Length -le $PrefixLength) -or ($String[$PrefixLength] -ne $Character)) { 70 | break outerloop 71 | } 72 | } 73 | $PrefixLength++ 74 | } 75 | 76 | $Strings[0].Substring(0, $PrefixLength) 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /modules/powertab/src/TabExpansion.ps1: -------------------------------------------------------------------------------- 1 | 2 | Function global:TabExpansion { 3 | param($Line, $LastWord) 4 | 5 | Invoke-TabExpansion -Line $Line -LastWord $LastWord 6 | } -------------------------------------------------------------------------------- /modules/powertab/src/TabExpansionCustomLib.ps1: -------------------------------------------------------------------------------- 1 | 2 | # Add Enum Functions 3 | [Void](Add-TabExpansion '|%' '| foreach {$_}' 'Alias') 4 | [Void](Add-TabExpansion '|?' '| where {$_}' 'Alias') 5 | [Void](Add-TabExpansion 'tqb' 'The quick brown fox jumps over the lazy dog') 6 | [Void](Add-TabExpansion 'Localhost' 'Localhost' 'Computer') 7 | 8 | # Help Shortcuts 9 | [Void](Add-TabExpansion 'h' 'Get-help $^ -Full') 10 | [Void](Add-TabExpansion 'h' 'Get-help $^ -Detailed') 11 | [Void](Add-TabExpansion 'h' 'Get-help $^ -Examples') 12 | 13 | # Font Selection 14 | #[Void]((New-Object System.Drawing.Text.InstalledFontCollection).Families | ForEach-Object { Add-TabExpansion 'FontFamily' $_.name }) 15 | 16 | # Invoke ShortCuts 17 | [Void](Add-TabExpansion 'now' 'Get-Date' 'Invoke') 18 | [Void](Add-TabExpansion 'date' 'Get-Date -date' 'Invoke') 19 | [Void](Add-TabExpansion 'time' 'Get-Date -time' 'Invoke') -------------------------------------------------------------------------------- /modules/powertab/src/handlers/PSClientManager.ps1: -------------------------------------------------------------------------------- 1 | ## PSClientManager 2 | 3 | $ClientFeatureHandler = { 4 | param($Context, [ref]$TabExpansionHasOutput) 5 | $Argument = $Context.Argument 6 | switch -exact ($Context.Parameter) { 7 | 'Name' { 8 | $TabExpansionHasOutput.Value = $true 9 | Get-ClientFeature "$Argument*" | Sort-Object Name | New-TabItem -Value {$_.Name} -Text {$_.Name} -ResultType ParameterValue 10 | } 11 | } 12 | } 13 | $AddClientFeatureHandler = { 14 | param($Context, [ref]$TabExpansionHasOutput) 15 | $Argument = $Context.Argument 16 | switch -exact ($Context.Parameter) { 17 | 'Name' { 18 | $TabExpansionHasOutput.Value = $true 19 | Get-ClientFeature "$Argument*" | Where-Object {$_.State -eq "Disabled"} | Sort-Object Name | 20 | New-TabItem -Value {$_.Name} -Text {$_.Name} -ResultType ParameterValue 21 | } 22 | } 23 | } 24 | $RemoveClientFeatureHandler = { 25 | param($Context, [ref]$TabExpansionHasOutput) 26 | $Argument = $Context.Argument 27 | switch -exact ($Context.Parameter) { 28 | 'Name' { 29 | $TabExpansionHasOutput.Value = $true 30 | Get-ClientFeature "$Argument*" | Where-Object {$_.State -eq "Enabled"} | Sort-Object Name | 31 | New-TabItem -Value {$_.Name} -Text {$_.Name} -ResultType ParameterValue 32 | } 33 | } 34 | } 35 | 36 | Register-TabExpansion "Add-ClientFeature" $AddClientFeatureHandler -Type "Command" 37 | Register-TabExpansion "Get-ClientFeature" $ClientFeatureHandler -Type "Command" 38 | Register-TabExpansion "Get-ClientFeatureInfo" $ClientFeatureHandler -Type "Command" 39 | Register-TabExpansion "Remove-ClientFeature" $RemoveClientFeatureHandler -Type "Command" 40 | -------------------------------------------------------------------------------- /modules/powertab/src/handlers/PlatyPS.ps1: -------------------------------------------------------------------------------- 1 | 2 | Register-TabExpansion "New-MarkdownHelp" -Type "Command" { 3 | param($Context, [ref]$TabExpansionHasOutput) 4 | $Argument = $Context.Argument 5 | switch -exact ($Context.Parameter) { 6 | 'Command' { 7 | $Commands = @(Get-Command "$Argument*" -CommandType Cmdlet,Function | Sort-Object Name) 8 | if ($Commands.Count -gt 0) { 9 | $TabExpansionHasOutput.Value = $true 10 | $Commands | New-TabItem -Value {$_.Name} -Text {$_.Name} -ResultType ParameterValue 11 | } 12 | } 13 | 'Locale' { 14 | $TabExpansionHasOutput.Value = $true 15 | $QuoteSpaces.Value = $false 16 | [System.Globalization.CultureInfo]::GetCultures([System.Globalization.CultureTypes]::InstalledWin32Cultures) | 17 | Where-Object {$_.Name -like "$Argument*"} | Sort-Object Name | 18 | New-TabItem -Value {$_.Name} -Text {$_.Name} -ResultType ParameterValue 19 | } 20 | 'Module' { 21 | $Modules = @(Get-Module "$Argument*" | Sort-Object Name) 22 | if ($Modules.Count -gt 0) { 23 | $TabExpansionHasOutput.Value = $true 24 | $Modules | New-TabItem -Value {$_.Name} -Text {$_.Name} -ResultType ParameterValue 25 | } 26 | } 27 | ## ModuleName ?? 28 | ## ModuleGuid ?? 29 | } 30 | }.GetNewClosure() -------------------------------------------------------------------------------- /modules/powertab/src/handlers/PowerShellGet.ps1: -------------------------------------------------------------------------------- 1 | ## Modules 2 | Register-TabExpansion "Get-InstalledModule" -Type "Command" { 3 | param($Context, [ref]$TabExpansionHasOutput) 4 | $Argument = $Context.Argument 5 | switch -exact ($Context.Parameter) { 6 | 'Name' { 7 | $Parameters = @{} 8 | $Modules = @(Get-InstalledModule "$Argument*" @Parameters | Sort-Object Name) 9 | if ($Modules.Count -gt 0) { 10 | $TabExpansionHasOutput.Value = $true 11 | $Modules | New-TabItem -Value {$_.Name} -Text {$_.Name} -ResultType ParameterValue 12 | } 13 | } 14 | } 15 | }.GetNewClosure() 16 | 17 | Register-TabExpansion "Uninstall-Module" -Type "Command" { 18 | param($Context, [ref]$TabExpansionHasOutput) 19 | $Argument = $Context.Argument 20 | switch -exact ($Context.Parameter) { 21 | 'Name' { 22 | $Parameters = @{} 23 | $Modules = @(Get-InstalledModule "$Argument*" @Parameters | Sort-Object Name) 24 | if ($Modules.Count -gt 0) { 25 | $TabExpansionHasOutput.Value = $true 26 | $Modules | New-TabItem -Value {$_.Name} -Text {$_.Name} -ResultType ParameterValue 27 | } 28 | } 29 | } 30 | }.GetNewClosure() 31 | 32 | Register-TabExpansion "Update-Module" -Type "Command" { 33 | param($Context, [ref]$TabExpansionHasOutput) 34 | $Argument = $Context.Argument 35 | switch -exact ($Context.Parameter) { 36 | 'Name' { 37 | $Parameters = @{} 38 | $Modules = @(Get-InstalledModule "$Argument*" @Parameters | Sort-Object Name) 39 | if ($Modules.Count -gt 0) { 40 | $TabExpansionHasOutput.Value = $true 41 | $Modules | New-TabItem -Value {$_.Name} -Text {$_.Name} -ResultType ParameterValue 42 | } 43 | } 44 | } 45 | }.GetNewClosure() 46 | 47 | ## PSRepository 48 | Register-TabExpansion "Get-PSRepository" -Type "Command" { 49 | param($Context, [ref]$TabExpansionHasOutput) 50 | $Argument = $Context.Argument 51 | switch -exact ($Context.Parameter) { 52 | 'Name' { 53 | $Parameters = @{} 54 | $PSRepositories = @(Get-PSRepository "$Argument*" @Parameters | Sort-Object Name) 55 | if ($Modules.Count -gt 0) { 56 | $TabExpansionHasOutput.Value = $true 57 | $PSRepositories | New-TabItem -Value {$_.Name} -Text {$_.Name} -ResultType ParameterValue 58 | } 59 | } 60 | } 61 | }.GetNewClosure() 62 | 63 | Register-TabExpansion "Set-PSRepository" -Type "Command" { 64 | param($Context, [ref]$TabExpansionHasOutput) 65 | $Argument = $Context.Argument 66 | switch -exact ($Context.Parameter) { 67 | 'Name' { 68 | $Parameters = @{} 69 | $PSRepositories = @(Get-PSRepository "$Argument*" @Parameters | Sort-Object Name) 70 | if ($Modules.Count -gt 0) { 71 | $TabExpansionHasOutput.Value = $true 72 | $PSRepositories | New-TabItem -Value {$_.Name} -Text {$_.Name} -ResultType ParameterValue 73 | } 74 | } 75 | } 76 | }.GetNewClosure() 77 | 78 | Register-TabExpansion "Unregister-PSRepository" -Type "Command" { 79 | param($Context, [ref]$TabExpansionHasOutput) 80 | $Argument = $Context.Argument 81 | switch -exact ($Context.Parameter) { 82 | 'Name' { 83 | $Parameters = @{} 84 | $PSRepositories = @(Get-PSRepository "$Argument*" @Parameters | Sort-Object Name) 85 | if ($Modules.Count -gt 0) { 86 | $TabExpansionHasOutput.Value = $true 87 | $PSRepositories | New-TabItem -Value {$_.Name} -Text {$_.Name} -ResultType ParameterValue 88 | } 89 | } 90 | } 91 | }.GetNewClosure() -------------------------------------------------------------------------------- /modules/powertab/src/handlers/Robocopy.ps1: -------------------------------------------------------------------------------- 1 | ## Robocopy 2 | & { 3 | Register-TabExpansion "robocopy.exe" -Type "Command" { 4 | param($Context, [ref]$TabExpansionHasOutput) 5 | $Argument = $Context.Argument 6 | switch -exact ($Context.Parameter) { 7 | 'Options' { 8 | $TabExpansionHasOutput.Value = $true 9 | if ($Argument -notlike "/*") {$Argument = "/$Argument"} 10 | $RoboHelp = robocopy.exe /? | Select-String '::' 11 | $r = [regex]'(.*)::(.*)' 12 | $RoboHelpObject = $RoboHelp | Select-Object ` 13 | @{Name='Parameter';Expression={$r.Match($_).Groups[1].Value.Trim()}}, 14 | @{Name='Description';Expression={$r.Match($_).Groups[2].Value.Trim()}} 15 | 16 | <# ## For now, we don't need category 17 | $RoboHelpObject = $RoboHelpObject | ForEach-Object {$Cat = 'General'} { 18 | if ($_.Parameter -eq '') { 19 | if ($_.Description -ne '') {$cat = $_.Description -replace 'options :',''} 20 | } else { 21 | $_ | Select-Object @{Name='Category';Expression={$cat}},Parameter,Description 22 | } 23 | } 24 | #> 25 | $RoboHelpObject | Where-Object {$_.Parameter -like "$Argument*"} | New-TabItem -Value {$_.Parameter} -Text {$_.Parameter} -ResultType ParameterName 26 | } 27 | } 28 | }.GetNewClosure() 29 | 30 | Function robocopyexeparameters { 31 | param( 32 | [Parameter(Position = 0)] 33 | [String]$Source 34 | , 35 | [Parameter(Position = 1)] 36 | [String]$Destination 37 | , 38 | [Parameter(Position = 2, ValueFromRemainingArguments = $true)] 39 | [String[]]$Options 40 | ) 41 | } 42 | 43 | $RobocopyCommandInfo = Get-Command "robocopyexeparameters" 44 | Register-TabExpansion "robocopy.exe" -Type "CommandInfo" { 45 | param($Context) 46 | $RobocopyCommandInfo 47 | }.GetNewClosure() 48 | } 49 | 50 | ## xcopy 51 | & { 52 | Register-TabExpansion "xcopy.exe" -Type "Command" { 53 | param($Context, [ref]$TabExpansionHasOutput) 54 | $Argument = $Context.Argument 55 | switch -exact ($Context.Parameter) { 56 | 'Options' { 57 | $TabExpansionHasOutput.Value = $true 58 | if ($Argument -notlike "/*") {$Argument = "/$Argument"} 59 | $r = [regex]'^\s\s(/\S+)*' 60 | xcopy.exe /? | . {process{$r.Match($_).Groups[1].Value.Trim()}} | Where-Object {$_ -like "$Argument*"} | 61 | New-TabItem -Value {$_} -Text {$_} -ResultType ParameterName 62 | } 63 | } 64 | }.GetNewClosure() 65 | 66 | Function xcopyexeparameters { 67 | param( 68 | [Parameter(Position = 0)] 69 | [String]$Source 70 | , 71 | [Parameter(Position = 1)] 72 | [String]$Destination 73 | , 74 | [Parameter(Position = 2, ValueFromRemainingArguments = $true)] 75 | [String[]]$Options 76 | ) 77 | } 78 | 79 | $xcopyCommandInfo = Get-Command "xcopyexeparameters" 80 | Register-TabExpansion "xcopy.exe" -Type "CommandInfo" { 81 | param($Context) 82 | $xcopyCommandInfo 83 | }.GetNewClosure() 84 | } 85 | 86 | ## cmdkey -------------------------------------------------------------------------------- /modules/powertab/src/handlers/Utilities.ps1: -------------------------------------------------------------------------------- 1 | 2 | ## netsh 3 | & { 4 | Register-TabExpansion netsh.exe -Type Command { 5 | param($Context, [ref]$TabExpansionHasOutput) 6 | $Argument = $Context.Argument 7 | switch -exact ($Context.Parameter) { 8 | 'r' { 9 | $TabExpansionHasOutput.Value = $true 10 | Get-TabExpansion "$Argument*" Computer | New-TabItem -Value {$_.Text} -Text {$_.Text} -ResultType ParameterValue 11 | } 12 | } 13 | }.GetNewClosure() 14 | 15 | Function netshexeparameters { 16 | param( 17 | [String]$a 18 | , 19 | [ValidateSet("advfirewall","branchcache","bridge","dhcpclient","dnsclient","firewall","http","interface","ipsec", 20 | "lan","mbn","namespace","nap","netio","p2p","ras","rpc","trace","wcn","wfp","winhttp","winsock","wlan")] 21 | [String]$c 22 | , 23 | [String]$r 24 | , 25 | [String]$u 26 | , 27 | [String]$p 28 | , 29 | [String]$f 30 | , 31 | [Parameter(Position = 0, ValueFromRemainingArguments = $true)] 32 | [String[]]$Commands 33 | ) 34 | } 35 | 36 | ## TODO: Handle commands and contexts 37 | 38 | $netshCommandInfo = Get-Command netshexeparameters 39 | Register-TabExpansion netsh.exe -Type CommandInfo { 40 | param($Context) 41 | $netshCommandInfo 42 | }.GetNewClosure() 43 | 44 | Register-TabExpansion netsh.exe -Type ParameterName { 45 | param($Context, $Parameter) 46 | $Parameters = "-a","-c","-r","-u","-p","-f" 47 | $Parameters | Where-Object {$_ -like "$Parameter*"} | New-TabItem -Value {$_} -Text {$_} -ResultType ParameterName 48 | }.GetNewClosure() 49 | } 50 | 51 | ## reg 52 | & { 53 | Register-TabExpansion reg.exe -Type Command { 54 | param($Context, [ref]$TabExpansionHasOutput) 55 | <# 56 | $Argument = $Context.Argument 57 | switch -exact ($Context.Parameter) { 58 | 'r' { 59 | $TabExpansionHasOutput.Value = $true 60 | Get-TabExpansion "$Argument*" Computer | New-TabItem {$_.Text} {$_.Text} -ResultType ParameterValue 61 | } 62 | } 63 | #> 64 | }.GetNewClosure() 65 | 66 | Function regexeparameters { 67 | param( 68 | [Parameter(Position = 0)] 69 | [ValidateSet("QUERY","ADD","DELETE","COPY","SAVE","RESTORE","LOAD","UNLOAD","COMPARE","EXPORT","IMPORT","FLAGS")] 70 | [String]$Command 71 | ) 72 | } 73 | 74 | ## TODO: Handle options 75 | 76 | $regCommandInfo = Get-Command regexeparameters 77 | Register-TabExpansion reg.exe -Type CommandInfo { 78 | param($Context) 79 | $regCommandInfo 80 | }.GetNewClosure() 81 | } 82 | -------------------------------------------------------------------------------- /modules/powertab/src/res/ColorThemes/ThemeAdmin.csv: -------------------------------------------------------------------------------- 1 | Name,Color 2 | BackColor,DarkRed 3 | BorderBackColor,DarkRed 4 | BorderColor,Black 5 | BorderTextColor,Yellow 6 | FilterColor,Gray 7 | SelectedBackColor,Yellow 8 | SelectedTextColor,black 9 | TextColor,Green -------------------------------------------------------------------------------- /modules/powertab/src/res/ColorThemes/ThemeBlog.csv: -------------------------------------------------------------------------------- 1 | #TYPE System.Management.Automation.PSCustomObject 2 | Name,Color 3 | BackColor,White 4 | BorderBackColor,Blue 5 | BorderColor,White 6 | BorderTextColor,Cyan 7 | FilterColor,Cyan 8 | SelectedBackColor,Cyan 9 | SelectedTextColor,Blue 10 | TextColor,Black 11 | -------------------------------------------------------------------------------- /modules/powertab/src/res/ColorThemes/ThemeBlue.csv: -------------------------------------------------------------------------------- 1 | Name,Color 2 | BackColor,Gray 3 | BorderBackColor,DarkBlue 4 | BorderColor,Blue 5 | BorderTextColor,Cyan 6 | FilterColor,yellow 7 | SelectedBackColor,Green 8 | SelectedTextColor,Blue 9 | TextColor,Blue -------------------------------------------------------------------------------- /modules/powertab/src/res/ColorThemes/ThemeCmdBlack.csv: -------------------------------------------------------------------------------- 1 | #TYPE System.Management.Automation.PSCustomObject 2 | Name,Color 3 | BackColor,Black 4 | BorderBackColor,Black 5 | BorderColor,White 6 | BorderTextColor,White 7 | FilterColor,Gray 8 | SelectedBackColor,Gray 9 | SelectedTextColor,Black 10 | TextColor,White 11 | -------------------------------------------------------------------------------- /modules/powertab/src/res/ColorThemes/ThemeCmdWhite.csv: -------------------------------------------------------------------------------- 1 | #TYPE System.Management.Automation.PSCustomObject 2 | Name,Color 3 | BackColor,White 4 | BorderBackColor,White 5 | BorderColor,DarkMagenta 6 | BorderTextColor,DarkMagenta 7 | FilterColor,DarkGray 8 | SelectedBackColor,DarkMagenta 9 | SelectedTextColor,White 10 | TextColor,DarkMagenta 11 | -------------------------------------------------------------------------------- /modules/powertab/src/res/ColorThemes/ThemeDigital.csv: -------------------------------------------------------------------------------- 1 | Name,Color 2 | BackColor,Black 3 | BorderBackColor,Black 4 | BorderColor,Green 5 | BorderTextColor,Green 6 | FilterColor,Gray 7 | SelectedBackColor,Red 8 | SelectedTextColor,Black 9 | TextColor,Green -------------------------------------------------------------------------------- /modules/powertab/src/res/ColorThemes/ThemeDragon.csv: -------------------------------------------------------------------------------- 1 | Name,Color 2 | BackColor,DarkRed 3 | BorderBackColor,Red 4 | BorderColor,Green 5 | BorderTextColor,Yellow 6 | FilterColor,Gray 7 | SelectedBackColor,DarkGreen 8 | SelectedTextColor,Yellow 9 | TextColor,Green 10 | -------------------------------------------------------------------------------- /modules/powertab/src/res/ColorThemes/ThemeGray.csv: -------------------------------------------------------------------------------- 1 | Name,Color 2 | BackColor,Black 3 | BorderBackColor,DarkGray 4 | BorderColor,Gray 5 | BorderTextColor,Black 6 | FilterColor,Gray 7 | SelectedBackColor,DarkGray 8 | SelectedTextColor,White 9 | TextColor,Gray 10 | -------------------------------------------------------------------------------- /modules/powertab/src/res/ColorThemes/ThemeGreen.csv: -------------------------------------------------------------------------------- 1 | Name,Color 2 | BackColor,Black 3 | BorderBackColor,Black 4 | BorderColor,Green 5 | BorderTextColor,Green 6 | FilterColor,Gray 7 | SelectedBackColor,DarkGreen 8 | SelectedTextColor,Green 9 | TextColor,DarkGreen 10 | -------------------------------------------------------------------------------- /modules/powertab/src/res/ColorThemes/ThemeGreenBs.csv: -------------------------------------------------------------------------------- 1 | Name,Color 2 | BackColor,Black 3 | BorderBackColor,Black 4 | BorderColor,Green 5 | BorderTextColor,Green 6 | FilterColor,Gray 7 | SelectedBackColor,DarkGreen 8 | SelectedTextColor,Green 9 | TextColor,DarkGreen -------------------------------------------------------------------------------- /modules/powertab/src/res/ColorThemes/ThemeHotdogStand.csv: -------------------------------------------------------------------------------- 1 | Name,Color 2 | BackColor,DarkRed 3 | BorderBackColor,Yellow 4 | BorderColor,Red 5 | BorderTextColor,Black 6 | FilterColor,red 7 | SelectedBackColor,yellow 8 | SelectedTextColor,Red 9 | TextColor,Yellow -------------------------------------------------------------------------------- /modules/powertab/src/res/ColorThemes/ThemeOriginal.csv: -------------------------------------------------------------------------------- 1 | Name,Color 2 | BackColor,DarkGray 3 | BorderBackColor,DarkBlue 4 | BorderColor,Blue 5 | BorderTextColor,Yellow 6 | FilterColor,Gray 7 | SelectedBackColor,DarkRed 8 | SelectedTextColor,Red 9 | TextColor,Yellow 10 | -------------------------------------------------------------------------------- /modules/powertab/src/res/ColorThemes/ThemeSpace.csv: -------------------------------------------------------------------------------- 1 | Name,Color 2 | BackColor,DarkRed 3 | BorderBackColor,DarkBlue 4 | BorderColor,Blue 5 | BorderTextColor,Yellow 6 | FilterColor,DarkGray 7 | SelectedBackColor,DarkRed 8 | SelectedTextColor,Red 9 | TextColor,Yellow 10 | -------------------------------------------------------------------------------- /modules/powertab/src/res/ColorThemes/ThemeWhite.csv: -------------------------------------------------------------------------------- 1 | Name,Color 2 | BackColor,white 3 | BorderBackColor,white 4 | BorderColor,Black 5 | BorderTextColor,Black 6 | FilterColor,Gray 7 | SelectedBackColor,Blue 8 | SelectedTextColor,white 9 | TextColor,Black -------------------------------------------------------------------------------- /modules/powertab/src/res/TabExpansion.Format.ps1xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | TraceEntry 6 | 7 | PowerTab.TraceEntry 8 | 9 | 10 | 11 | 12 | 13 | 8 14 | left 15 | 16 | 17 | 18 | 30 19 | left 20 | 21 | 22 | 23 | left 24 | 25 | 26 | 27 | 28 | 29 | 30 | $_.TraceId.ToString().Substring(0,8) 31 | 32 | 33 | $_.Location.Command 34 | 35 | 36 | Message 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | TraceEntryLocation 45 | 46 | PowerTab.TraceEntry 47 | 48 | 49 | 50 | 51 | 52 | 8 53 | left 54 | 55 | 56 | 57 | 30 58 | left 59 | 60 | 61 | 62 | left 63 | 64 | 65 | 66 | 67 | 68 | 69 | $_.TraceId.ToString().Substring(0,8) 70 | 71 | 72 | $_.Location.Location -replace '(^.+:) Line (.+)$','$1$2' 73 | 74 | 75 | Message 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /modules/powertab/src/res/en-US/Resources.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | ## en-US 3 | export_tabexpansionconfig_ver_success = "Configuration exported to '{0}'" 4 | export_tabexpansiondatabase_ver_success = "TabExpansion database exported to '{0}'" 5 | global_choice_no = "&No" 6 | global_choice_yes = "&Yes" 7 | import_tabexpansionconfig_ver_success = "Configuration imported from '{0}'" 8 | import_tabexpansiondatabase_ver_success = "TabExpansion database imported from '{0}'" 9 | invoke_tabactivityindicator_prog_status = "PowerTab is retrieving or displaying available tab expansion options." 10 | setup_wizard_add_to_profile = "Add the following text to the PowerShell profile to launch PowerTab with the saved configuration." 11 | setup_wizard_caption = "Launch the setup wizard to create a PowerTab configuration file and database?" 12 | setup_wizard_choice_appdata_directory = "&Application Data Directory" 13 | setup_wizard_choice_install_directory = "&Installation Directory" 14 | setup_wizard_choice_isostorage_directory = "Isolated &Storage" 15 | setup_wizard_choice_other_directory = "&Other Directory" 16 | setup_wizard_choice_profile_directory = "&Profile Directory" 17 | setup_wizard_config_location_caption = "Where should the PowerTab configuration file and database be saved?" 18 | setup_wizard_config_location_message = "Any existing PowerTab configuration will be overwritten." 19 | setup_wizard_err_path_not_valid = "The given path's format is not supported." 20 | setup_wizard_message = "PowerTab can be setup manually without the setup wizard." 21 | setup_wizard_other_directory_prompt = "Enter the directory path for storing the PowerTab configuration file and database" 22 | setup_wizard_update_profile_caption = "Update current profile to automatically import PowerTab?" 23 | setup_wizard_update_profile_message = "To manually update the current profile or another profile, select 'No'." 24 | setup_wizard_upgrade_existing_database_caption = "Upgrade existing tab completion database?" 25 | setup_wizard_upgrade_existing_database_message = "An existing tab completion database has been detected." 26 | update_tabexpansiondatabase_com_activity = "Adding COM Classes" 27 | update_tabexpansiondatabase_com_conf_caption = "Update COM class list in tab completion database?" 28 | update_tabexpansiondatabase_com_conf_description = "Loading COM classes." 29 | update_tabexpansiondatabase_com_conf_inquire = "Loading COM classes." 30 | update_tabexpansiondatabase_computer_activity = "Adding computer names" 31 | update_tabexpansiondatabase_computer_conf_caption = "Update computer list in tab completion database from 'net view'?" 32 | update_tabexpansiondatabase_computer_conf_description = "Loading computer names." 33 | update_tabexpansiondatabase_computer_conf_inquire = "Loading computer names." 34 | update_tabexpansiondatabase_type_conf_caption = "Update .NET type list in tab completion database from currently loaded types?" 35 | update_tabexpansiondatabase_type_conf_description = "Loading .NET types." 36 | update_tabexpansiondatabase_type_conf_inquire = "Loading .NET types." 37 | update_tabexpansiondatabase_wmi_activity = "Adding WMI Classes" 38 | update_tabexpansiondatabase_wmi_conf_caption = "Update WMI class list in tab completion database?" 39 | update_tabexpansiondatabase_wmi_conf_description = "Loading WMI classes." 40 | update_tabexpansiondatabase_wmi_conf_inquire = "Loading WMI classes." 41 | } 42 | -------------------------------------------------------------------------------- /modules/powertab/src/res/en/Resources.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | ## en 3 | export_tabexpansionconfig_ver_success = "Configuration exported to '{0}'" 4 | export_tabexpansiondatabase_ver_success = "TabExpansion database exported to '{0}'" 5 | global_choice_no = "&No" 6 | global_choice_yes = "&Yes" 7 | import_tabexpansionconfig_ver_success = "Configuration imported from '{0}'" 8 | import_tabexpansiondatabase_ver_success = "TabExpansion database imported from '{0}'" 9 | invoke_tabactivityindicator_prog_status = "PowerTab is retrieving or displaying available tab expansion options." 10 | setup_wizard_add_to_profile = "Add the following text to the PowerShell profile to launch PowerTab with the saved configuration." 11 | setup_wizard_caption = "Launch the setup wizard to create a PowerTab configuration file and database?" 12 | setup_wizard_choice_appdata_directory = "&Application Data Directory" 13 | setup_wizard_choice_install_directory = "&Installation Directory" 14 | setup_wizard_choice_isostorage_directory = "Isolated &Storage" 15 | setup_wizard_choice_other_directory = "&Other Directory" 16 | setup_wizard_choice_profile_directory = "&Profile Directory" 17 | setup_wizard_config_location_caption = "Where should the PowerTab configuration file and database be saved?" 18 | setup_wizard_config_location_message = "Any existing PowerTab configuration will be overwritten." 19 | setup_wizard_err_path_not_valid = "The given path's format is not supported." 20 | setup_wizard_message = "PowerTab can be setup manually without the setup wizard." 21 | setup_wizard_other_directory_prompt = "Enter the directory path for storing the PowerTab configuration file and database" 22 | setup_wizard_update_profile_caption = "Update current profile to automatically import PowerTab?" 23 | setup_wizard_update_profile_message = "To manually update the current profile or another profile, select 'No'." 24 | setup_wizard_upgrade_existing_database_caption = "Upgrade existing tab completion database?" 25 | setup_wizard_upgrade_existing_database_message = "An existing tab completion database has been detected." 26 | update_tabexpansiondatabase_com_activity = "Adding COM Classes" 27 | update_tabexpansiondatabase_com_conf_caption = "Update COM class list in tab completion database?" 28 | update_tabexpansiondatabase_com_conf_description = "Loading COM classes." 29 | update_tabexpansiondatabase_com_conf_inquire = "Loading COM classes." 30 | update_tabexpansiondatabase_computer_activity = "Adding computer names" 31 | update_tabexpansiondatabase_computer_conf_caption = "Update computer list in tab completion database from 'net view'?" 32 | update_tabexpansiondatabase_computer_conf_description = "Loading computer names." 33 | update_tabexpansiondatabase_computer_conf_inquire = "Loading computer names." 34 | update_tabexpansiondatabase_type_conf_caption = "Update .NET type list in tab completion database from currently loaded types?" 35 | update_tabexpansiondatabase_type_conf_description = "Loading .NET types." 36 | update_tabexpansiondatabase_type_conf_inquire = "Loading .NET types." 37 | update_tabexpansiondatabase_wmi_activity = "Adding WMI Classes" 38 | update_tabexpansiondatabase_wmi_conf_caption = "Update WMI class list in tab completion database?" 39 | update_tabexpansiondatabase_wmi_conf_description = "Loading WMI classes." 40 | update_tabexpansiondatabase_wmi_conf_inquire = "Loading WMI classes." 41 | } 42 | -------------------------------------------------------------------------------- /modules/powertabargcompleters/psakefile.ps1: -------------------------------------------------------------------------------- 1 | Properties { 2 | $ModuleName = 'PTAG' 3 | $RootDirectory = "$PSScriptRoot/../.." 4 | $HelpDirectory = "$PSScriptRoot/help" 5 | $SrcDirectory = "$PSScriptRoot/src" 6 | $TestDirectory = "$PSScriptRoot/test" 7 | $OutputDirectory = "$RootDirectory/build/$ModuleName" 8 | $ReportDirectory = "$RootDirectory/build/reports/$ModuleName" 9 | $DeployDirectory = "$HOME/Documents/WindowsPowerShell/Modules/$ModuleName" 10 | } 11 | 12 | Task 'default' -Depends build 13 | 14 | Task 'clean' { 15 | if (Test-Path $OutputDirectory) { 16 | Remove-Item $OutputDirectory -Recurse -Force 17 | } 18 | } 19 | 20 | Task 'buildHelp' { 21 | # New-Item $OutputDirectory -ItemType Directory -ErrorAction SilentlyContinue > $null 22 | 23 | # New-ExternalHelp -Path $HelpDirectory -OutputPath $OutputDirectory 24 | 25 | # ## Copy about topics 26 | # Copy-Item "$HelpDirectory/*" -Include "about_*.txt" -Destination $OutputDirectory -Force 27 | } 28 | 29 | Task 'build' -Depends buildHelp { 30 | New-Item $OutputDirectory -ItemType Directory -ErrorAction SilentlyContinue > $null 31 | 32 | ## Copy manifest 33 | Copy-Item "$SrcDirectory/$ModuleName.psd1" -Destination $OutputDirectory -Force 34 | 35 | ## Build module 36 | $ModuleContent = @( 37 | 'using namespace System.Management.Automation', 38 | 'param()' 39 | ) 40 | foreach ($script in (Get-ChildItem "$SrcDirectory/utils" -Include '*.ps1' -Recurse)) { 41 | $ModuleContent += Get-Content $script.FullName 42 | } 43 | foreach ($script in (Get-ChildItem "$SrcDirectory/completers" -Include '*.ps1' -Recurse)) { 44 | $ModuleContent += Get-Content $script.FullName 45 | } 46 | # $ModuleContent += Get-Content "$SrcDirectory/$ModuleName.psm1" 47 | Set-Content "$OutputDirectory/$ModuleName.psm1" -Value $ModuleContent -Encoding UTF8 -Force 48 | 49 | ## Copy resources 50 | # Copy-Item "$SrcDirectory/res/*" -Destination $OutputDirectory -Recurse -Force 51 | } 52 | 53 | Task 'deploy' { 54 | if (Test-Path $DeployDirectory) { 55 | Remove-Item $DeployDirectory -Recurse -Force 56 | } 57 | 58 | New-Item $DeployDirectory -ItemType Directory -ErrorAction SilentlyContinue > $null 59 | 60 | Copy-Item "$OutputDirectory/*" -Destination $DeployDirectory -Recurse -Force 61 | } 62 | 63 | Task 'checkStyle' { 64 | New-Item $ReportDirectory -ItemType Directory -ErrorAction SilentlyContinue > $null 65 | 66 | $FilesToCheck = Get-ChildItem $SrcDirectory -Include *.ps1 -Recurse 67 | $FilesToCheck += Get-ChildItem $OutputDirectory -Include *.psd1 -Recurse 68 | 69 | $Results = $FilesToCheck | ForEach-Object {Invoke-ScriptAnalyzer $_.FullName} 70 | $Results | Where-Object Severity -eq "Error" | Format-Table | Out-String | Write-Host -ForegroundColor Red 71 | $Results | Select-Object RuleName,Severity,Line,Column,ScriptName,Message | ConvertTo-Csv -NoTypeInformation | Set-Content "$ReportDirectory/checkstyle.csv" -Force 72 | } 73 | 74 | Task 'test' { 75 | New-Item $ReportDirectory -ItemType Directory -ErrorAction SilentlyContinue > $null 76 | 77 | Invoke-Pester ` 78 | -OutputFile "$ReportDirectory/tests_unit.xml" -CodeCoverage "$SrcDirectory/completers/*.ps1" -CodeCoverageOutputFile "$ReportDirectory/coverage.xml" 79 | } -------------------------------------------------------------------------------- /modules/powertabargcompleters/src/PTAG.psd1: -------------------------------------------------------------------------------- 1 | @{ 2 | ## Module Info 3 | ModuleVersion = '1.0.0' 4 | Description = "A library of argument completers." 5 | GUID = '3ad03dca-ce9c-4a0b-92bc-36eee90828ae' 6 | # HelpInfoURI = '' 7 | 8 | ## Module Components 9 | RootModule = @("PTAG.psm1") 10 | ScriptsToProcess = @() 11 | TypesToProcess = @() 12 | FormatsToProcess = @() 13 | FileList = @() 14 | 15 | ## Public Interface 16 | CmdletsToExport = @() 17 | FunctionsToExport = @() 18 | VariablesToExport = @() 19 | AliasesToExport = @() 20 | # DscResourcesToExport = @() 21 | # DefaultCommandPrefix = '' 22 | 23 | ## Requirements 24 | # CompatiblePSEditions = @() 25 | PowerShellVersion = '3.0' 26 | # PowerShellHostName = '' 27 | # PowerShellHostVersion = '' 28 | RequiredModules = @() 29 | RequiredAssemblies = @() 30 | ProcessorArchitecture = 'None' 31 | DotNetFrameworkVersion = '2.0' 32 | CLRVersion = '2.0' 33 | 34 | ## Author 35 | Author = 'Jason Archer' 36 | CompanyName = '' 37 | Copyright = '' 38 | 39 | ## Private Data 40 | PrivateData = @{ 41 | PSData = @{ 42 | # Tags applied to this module. These help with module discovery in online galleries. 43 | Tags = @("powertab","productivity","tabexpansion","tab-completion","Register-ArgumentCompleter") 44 | 45 | # A URL to the license for this module. 46 | # LicenseUri = '' 47 | 48 | # A URL to the main website for this project. 49 | ProjectUri = 'https://github.com/jasonmarcher/PowerTab' 50 | 51 | # A URL to an icon representing this module. 52 | # IconUri = '' 53 | 54 | # ReleaseNotes of this module 55 | ReleaseNotes = @" 56 | ## 2018-01-29 - Version 1.0.0 57 | 58 | Features: 59 | 60 | - Modules 61 | - International 62 | - Microsoft.PowerShell.Core 63 | - Microsoft.PowerShell.Diagnostics 64 | - Microsoft.PowerShell.Management 65 | - Microsoft.PowerShell.Operation.Validation 66 | - Microsoft.PowerShell.Utility 67 | 68 | Detailed list of supported parameters available here: 69 | https://github.com/jasonmarcher/PowerTab/blob/master/Docs/ptag/FeatureList.md 70 | 71 | "@ 72 | } # End of PSData hashtable 73 | } # End of PrivateData hashtable 74 | } 75 | -------------------------------------------------------------------------------- /modules/powertabargcompleters/src/completers/Native.PowerShell.ps1: -------------------------------------------------------------------------------- 1 | Register-ArgumentCompleter -Native -CommandName powershell -ScriptBlock { 2 | param($wordToComplete, $commandAst, $cursorPosition) 3 | 4 | $Parameters = '-Command','-ConfigurationName','-EncodedCommand','-ExecutionPolicy','-File','-Help', 5 | '-InputFormat','-Mta','-NoExit','-NoLogo','-NonInteractive','-NoProfile','-OutputFormat', 6 | '-PSConsoleFile','-Sta','-Version','-WindowStyle' 7 | 8 | $LastArgument = $commandAst.CommandElements[-1] 9 | 10 | if ($LastArgument -is [System.Management.Automation.Language.CommandParameterAst]) { 11 | switch ($LastArgument.ParameterName) { 12 | 'Command' { 13 | break 14 | } 15 | 'ConfigurationName' { 16 | break 17 | } 18 | 'EncodedCommand' { 19 | break 20 | } 21 | 'ExecutionPolicy' { 22 | 'Unrestricted', 'RemoteSigned', 'AllSigned', 'Restricted', 'Bypass', 'Undefined' | 23 | NewTabItem -Value {$_} -Text {$_} -ResultType ParameterValue 24 | break 25 | } 26 | 'File' { 27 | break 28 | } 29 | 'InputFormat' { 30 | 'Text', 'Xml' | NewTabItem -Value {$_} -Text {$_} -ResultType ParameterValue 31 | break 32 | } 33 | 'PSConsoleFile' { 34 | break 35 | } 36 | 'Version' { 37 | '1.0', '2.0', '3.0', '4.0', '5.0', '5.1', '6.0' | 38 | NewTabItem -Value {$_} -Text {$_} -ResultType ParameterValue 39 | break 40 | } 41 | 'Version' { 42 | '1.0', '2.0', '3.0', '4.0', '5.0', '5.1', '6.0' | 43 | NewTabItem -Value {$_} -Text {$_} -ResultType ParameterValue 44 | break 45 | } 46 | 'WindowStyle' { 47 | 'Normal','Minimized','Maximized','Hidden' | 48 | NewTabItem -Value {$_} -Text {$_} -ResultType ParameterValue 49 | break 50 | } 51 | default { 52 | $Parameters | NewTabItem -Value {$_} -Text {$_} -ResultType ParameterValue 53 | } 54 | } 55 | } else { 56 | $Parameters | Where-Object {$_ -like "$wordToComplete*"} | 57 | NewTabItem -Value {$_} -Text {$_} -ResultType ParameterValue 58 | } 59 | 60 | <# 61 | PowerShell[.exe] [-PSConsoleFile | -Version ] 62 | [-NoLogo] [-NoExit] [-Sta] [-Mta] [-NoProfile] [-NonInteractive] 63 | [-InputFormat {Text | XML}] [-OutputFormat {Text | XML}] 64 | [-WindowStyle