jasonmarcher / powertab Goto Github PK
View Code? Open in Web Editor NEWTab expansion module for PowerShell. Handles more content and provides a new, optional interface.
License: MIT License
Tab expansion module for PowerShell. Handles more content and provides a new, optional interface.
License: MIT License
This will be tricky because we have to figure out what object will be sent to the Format cmdlet.
The core handler should preempt the FileSystem expansion if the last word matches one of the regex cases in the switch.
If you don't include quotes and try to do TabExpansion to invoke an item, it will add quotes and then escape the quotes.
Example:
C:<TAB>
Then go to "Program Files", hit "", go to "Common Files" or other directory, hit enter:
Results:
& "& "c:\Program Files\Common Files"
I tried it with "c:\Program Files\Common Files\Microsoft Shared\Windows Live\HWDeviceLogin.dll"
And I got:
& "&"& "&"&```````````"c:\Program Files\Common Files\Microsoft Shared\Windows Live\HWDeviceLogin.dll"
Originally reported by StephenMills
The context parser has another issue with lists:
Remove-PSBreakpoint (Get-PSBreakPoint -Id 2), <TAB>
It might be useful to have a handler for DateTime typed parameters. Either show a date picker or a slick in-console-buffer interface (could be a lot of work though).
On Powershell 2.0 I can do: get-, powertab show the list of possible commands filtering them based on new typed characters; if I type get- then any character not resolved to an existing command powertab close the list leaving the current command.
In powershell 3.0 if I type after a character that is not resolved as command it returns just the character typed, deleting the get- (or whatever other verb)
This behaviour only with $PowerTabConfig.DefaultHandler = 'Dynamic'
PS C:\ps> $PowerTabLog.Error
Resolve-InternalCommandName : Impossibile convalidare l'argomento sul parametro 'CommandInfo'. L'argomento è null.
Fornire un argomento non null ed eseguire di nuovo il comando.
In C:\Users\io\Documents\WindowsPowerShell\Modules\PowerTab\TabExpansionCore.ps1:269 car:60
$InternalCommand = Resolve-InternalCommandName $CurrentContext.Comma ...
~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : InvalidData: (:) [Resolve-InternalCommandName], ParameterBindingValidationException
FullyQualifiedErrorId : ParameterArgumentValidationError,Resolve-InternalCommandName
Get-Command : Termine 'get-' non riconosciuto come nome di cmdlet, funzione, programma eseguibile o file script.
Controllare l'ortografia del nome o verificare che il percorso sia incluso e corretto, quindi riprovare.
In C:\Users\io\Documents\WindowsPowerShell\Modules\PowerTab\TabExpansionUtil.ps1:130 car:34
$Command = @(Get-Command $Name)[0]
~~~~~~~~~~~~~~~~~
CategoryInfo : ObjectNotFound: (get-:String) [Get-Command], CommandNotFoundException
FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand
Get-Command : Termine 'Get-get-' non riconosciuto come nome di cmdlet, funzione, programma eseguibile o file script.
Controllare l'ortografia del nome o verificare che il percorso sia incluso e corretto, quindi riprovare.
In C:\Users\io\Documents\WindowsPowerShell\Modules\PowerTab\TabExpansionUtil.ps1:133 car:45
if (-not ($Command = try {@(Get-Command "Get-$Name")[0]} catch { ...
~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : ObjectNotFound: (Get-get-:String) [Get-Command], CommandNotFoundException
FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand
Get-Command : Termine 'get-' non riconosciuto come nome di cmdlet, funzione, programma eseguibile o file script.
Controllare l'ortografia del nome o verificare che il percorso sia incluso e corretto, quindi riprovare.
In C:\Users\io\Documents\WindowsPowerShell\Modules\PowerTab\TabExpansionUtil.ps1:130 car:34
$Command = @(Get-Command $Name)[0]
~~~~~~~~~~~~~~~~~
CategoryInfo : ObjectNotFound: (get-:String) [Get-Command], CommandNotFoundException
FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand
I had a crazy idea. It might be nice to be able to see parameters grouped by parameter set as a way to show usage information while tab expanding parameter names. This would be a relatively complex addition.
Support for CommandName and FormatTypeName. Also improve support for -Module.
At least respond to CTRL-C.
After importing PowerTab module, autocomplete stops working for existing user functions. How to reproduce:
powershell -NoProfile
function Hello {"Hello world"}
H -> Hello
Import-Module PowerTab
H -> Nothing
Originally reported on Codeplex by FallenGameR
Add a basic tracing "debug" log to PowerTab. This helps diagnose problems (such as certain command lines not being handled correctly).
I've recently started using the PSReadline module and now feel like I can't live without it. Unfortunately, as it stands, PSReadline and PowerTab seem to be incompatible, throwing an error every time the PowerTab dialog is instantiated.
I was wondering if this is something that anybody has managed to address in their startup scripts or if there are any plans to address this issue in the source code. I'm not experienced enough to write a solution for this myself and would hate to be forced to choose between these two wonderful pieces of code as a result.
Originally reported on CodePlex by lsabbatini.
Just installed V3 today. The powertab.psm1 script wants to access function:tabexpansion which does not exist ootb in v3. -ErrorAction SilentlyContinue prevents this error. Updating the tabexpansion DB gives more errors in the WMI section. Do you have plans to fix those near-term? Would be great.
Current layout:
Version : 1.0.0
Enabled : True
Colors : {PowerTab Color Configuration}
ShortcutChars : {PowerTab Shortcut Characters}
Setup : {PowerTab Setup Data}
DefaultHandler : Dynamic
CustomUserFunction : Write-Warning
AlternateHandler : Dynamic
CustomCompletionChars : ]:)
DoubleBorder : True
BackSlashComplete : True
DotComplete : True
ShowBanner : False
SpaceComplete : True
DoubleTabLock : False
AutoExpandOnBackSlash : True
CustomFunctionEnabled : False
VisualStudioTabBehavior : False
FileSystemExpand : True
CloseListOnEmptyFilter : True
AliasQuickExpand : False
IgnoreConfirmPreference : False
DoubleTabEnabled : False
TabActivityIndicator : True
AutoExpandOnDot : True
ShowAccessorMethods : True
CustomComplete : True
MinimumListItems : 2
FastScrollItemcount : 10
Notes for a better layout:
Version : 1.0.0
Enabled : True Enable PowerTab, pass through to host if disabled
Setup : {PowerTab Setup Data}
TabActivityIndicator : True Show activity indicator?
ShowBanner : False Show startup banner on import
ConsoleList Only:
MinimumListItems : 2
FastScrollItemcount : 10
CloseListOnEmptyFilter : True
DotComplete : True
AutoExpandOnDot : True
BackSlashComplete : True
AutoExpandOnBackSlash : True
SpaceComplete : True
CustomComplete : True
CustomCompletionChars : ]:)
VisualStudioTabBehavior : False
DoubleBorder : True
Colors : {PowerTab Color Configuration}
Core Behavior:
DefaultItemSelector : Dynamic Default item selector
AlternateItemSelector : Dynamic Alternate item selector
DoubleTabEnabled : False Double tap <TAB> to invoke AlternateItemSelector
DoubleTabLock : False Always invoke AlternateItemSelector
AliasQuickExpand : False Convert Aliases to Commands using Alias shortcut character (also if DoubleTab)
CustomFunctionEnabled : False Invoke CustomUserFunction using CustomFunction shortcut character
CustomUserFunction : ... Custom user function to invoke
FileSystemExpand : True Use PowerTab to expand provider paths
ShowAccessorMethods : True Show get_/set_ methods on objects?
IgnoreConfirmPreference : False Set ConfirmPreference to High during tab expansion
ShortcutChars : {PowerTab Shortcut Characters}
Trying PowerTab in Windows 8.1 preview.
Installation completes and [Tab] is working, but when PowerTab is loading error was occured (path "Function:\TabExpansion" not found).
Have seen same issue for V3 version, but " -ErrorAction SilentlyContinue" have no effect (I'm not familiar with PS and may be used it erroneously).
Windows PowerShell
(C) Корпорация Майкрософт, 2013. Все права защищены.
Get-Content : Не удается найти путь "Function:\TabExpansion", так как он не существует.
C:\Users\XXX\Documents\WindowsPowerShell\Modules\PowerTab\PowerTab.psm1:17 знак:20
+ $OldTabExpansion = Get-Content Function:TabExpansion
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Function:\TabExpansion:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
PowerTab version 0.99.6.0 PowerShell TabExpansion Library
Host: ConsoleHost
PowerTab Enabled: True
PS C:\Users\XXX> get-host
Name : ConsoleHost
Version : 4.0
InstanceId : 34ad679a-dcf3-4195-bf68-ca37d523679c
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : ru-RU
CurrentUICulture : ru-RU
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
In naked Powershell, if I type "notepad \temp.txt" and hit [tab], the "" gets replaced with "C:\Users\moswald", which is a good thing since notepad doesn't understand what "~" is.
As far as I can tell, if PowerTab is installed this no longer works.
Originally reported on Codeplex by moswald
This does not give the desired result:
$Culture = [System.Globalization.CultureInfo]::CurrentUICulture.paren<TAB>
Originally reported by nightroman.
This is a known defect of the console (before Windows 10) with clear type fonts. On closing the menu some vertical ghost lines may stay visible, namely, at the left or right menu border or both.
The remedy is to store/restore not just the buffer area of the menu but the buffer rectangle from the left most to the right most. I will submit the PR shortly.
Suggested fix:
cspotcode/PS-GuiCompletion@e159b61
Right now variable expansion is done with "$variable". But it would be nice to tab expand paths with variables in them and not expand the variables.
When doing TabExpansion, don't include parameters that have already been referenced. This would make it easier when you have cmdlets that have many parameters like Quests Active Directory Snapin with Get-QADUser. It has 97 parameters and doing anything to make it easier to find what you are looking for is a help.
For Example:
Get-Command -Name Get-* -n
Results:
-Name
-Noun
Desired Results:
-Noun
I believe this could be done using $Context.OtherParameters and remove the ones from the result that are in OtherParameters.
Originally reported by StephenMills
PS> Import-Module -Name $HOME\Documents\WindowsPowerShell\PowerTab
Launch the setup wizard to create a PowerTab configuration file and database?
PowerTab can be setup manually without the setup wizard.
[N] No [Y] Yes [?] Help (default is "Y"): y
Where should the PowerTab configuration file and database be saved?
Any existing PowerTab configuration will be overwritten.
[P] Profile Directory [I] Installation Directory [A] Application Data Directory [S] Isolated Storage
[O] Other Directory[?] Help (default is "P"):
Select-String : Cannot find path 'C:\Users[redacted]\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'
because it does not exist.
At C:\Users[redacted]\Documents\WindowsPowerShell\PowerTab\PowerTab.psm1:189 char:19
if (-not (Select-String "Start of PowerTab Initialization Code" $PROFILE ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : ObjectNotFound: (C:\Users[redacted]...ell_profile.ps1:String) [Select-String], ItemNotFound
Exception
FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SelectStringCommand
Update .NET type list in tab completion database from currently loaded types?
Loading .NET types.
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
Incorrect spelling of 'config' in the first sentence. Please correct.
--> To load an existing conifig file into PowerTab
Observed behavior
Typing the following
PS> dir \HOSTNAME\c$\<TAB><SELECT ANY ENTRY><ENTER>
causes the following:
PS> dir "\HOSTNAME\c`$\MyFavoriteDirectory"
Notice the extra backtick escaping the $
, which is in fact part of the path.
Expected Behavior
UNC paths that contain $
as a valid part of their path are not escaped. This can be detected if the $
immediately preceeds a \
Originally reported on CodePlex by jonhclark.
Last version have an issue with module loading from network location - we get Exception calling "ReadXml" with "2" argument(s): "The given path's format is not supported."
At \server\homefolder\My Documents\WindowsPowerShell\Modules\PowerTab\TabExpansionLib.ps1:1213 and at TabExpansionLib.ps1:1267
I believe TabExpansionLib.ps1 Lines 1210 & 1263 must be coded as
if (![System.IO.Path]::IsPathRooted($LiteralPath)) {
instead of
if (![System.IO.Path]::IsPathRooted($_)) {
it is functions InternalImportTabExpansionDataBase and InternalImportTabExpansionConfig
Originally reported by jbumorija
1st time it failed to install the db of .Net stuff
2nd time:
PS Z:> Import-Module PowerTab
VERBOSE: Loading module from path '\corp\root\home\steffanr\My
Documents\WindowsPowerShell\Modules\PowerTab\PowerTab.psd1'.
VERBOSE: Loading module from path '\corp\root\home\steffanr\My
Documents\WindowsPowerShell\Modules\PowerTab\PowerTab.psm1'.
VERBOSE: Loading module from path '\corp\root\home\steffanr\My
Documents\WindowsPowerShell\Modules\PowerTab\Lerch.PowerShell.dll'.
Exception calling "ReadXml" with "2" argument(s): "The given path's format is not supported."
At \corp\root\home\steffanr\My Documents\WindowsPowerShell\Modules\PowerTab\TabExpansionLib.ps1:1267 char:30
[Void]$Config.ReadXml <<<< ($LiteralPath, 'InferSchema')
CategoryInfo : NotSpecified: (:) [], MethodInvocationException
FullyQualifiedErrorId : DotNetMethodException
You cannot call a method on a null-valued expression.
At \corp\root\home\steffanr\My Documents\WindowsPowerShell\Modules\PowerTab\TabExpansionLib.ps1:1272 char:47
$Version = $Config.Tables['Config'].Select <<<< ("Name = 'Version'")[0].Value -as [System.Version]
CategoryInfo : InvalidOperation: (Select:String) [], RuntimeException
FullyQualifiedErrorId : InvokeMethodOnNull
The variable '$Version' cannot be retrieved because it has not been set.
At \corp\root\home\steffanr\My Documents\WindowsPowerShell\Modules\PowerTab\TabExpansionLib.ps1:1273 char:17
if ($Version <<<< -eq $null) {$Config.Tables['Config'].Select("Name = 'Version'")[0].Value = '0.99.0.0'}
CategoryInfo : InvalidOperation: (Version:Token) [], RuntimeException
FullyQualifiedErrorId : VariableIsUndefined
You cannot call a method on a null-valued expression.
At \corp\root\home\steffanr\My Documents\WindowsPowerShell\Modules\PowerTab\TabExpansionLib.ps1:940 char:47
$Version = $Config.Tables['Config'].Select <<<< ("Name = 'Version'")[0].Value -as [System.Version]
CategoryInfo : InvalidOperation: (Select:String) [], RuntimeException
FullyQualifiedErrorId : InvokeMethodOnNull
The variable '$Version' cannot be retrieved because it has not been set.
At \corp\root\home\steffanr\My Documents\WindowsPowerShell\Modules\PowerTab\TabExpansionLib.ps1:943 char:17
if ($Version <<<< -lt ([System.Version]'0.99.3.0')) {
CategoryInfo : InvalidOperation: (Version:Token) [], RuntimeException
FullyQualifiedErrorId : VariableIsUndefined
The variable '$DatabasePath' cannot be retrieved because it has not been set.
At \corp\root\home\steffanr\My Documents\WindowsPowerShell\Modules\PowerTab\TabExpansionLib.ps1:949 char:35
if (!(Split-Path $DatabasePath <<<< )) {
CategoryInfo : InvalidOperation: (DatabasePath:Token) [], RuntimeException
FullyQualifiedErrorId : VariableIsUndefined
The variable '$DatabasePath' cannot be retrieved because it has not been set.
At \corp\root\home\steffanr\My Documents\WindowsPowerShell\Modules\PowerTab\TabExpansionLib.ps1:953 char:65
$Database = InternalImportTabExpansionDataBase $DatabasePath <<<<
CategoryInfo : InvalidOperation: (DatabasePath:Token) [], RuntimeException
FullyQualifiedErrorId : VariableIsUndefined
The variable '$Version' cannot be retrieved because it has not been set.
At \corp\root\home\steffanr\My Documents\WindowsPowerShell\Modules\PowerTab\TabExpansionLib.ps1:956 char:17
if ($Version <<<< -lt $CurVersion) {
CategoryInfo : InvalidOperation: (Version:Token) [], RuntimeException
FullyQualifiedErrorId : VariableIsUndefined
The variable '$Database' cannot be retrieved because it has not been set.
At \corp\root\home\steffanr\My Documents\WindowsPowerShell\Modules\PowerTab\TabExpansionLib.ps1:965 char:47
$script:dsTabExpansionDatabase = $Database <<<<
CategoryInfo : InvalidOperation: (Database:Token) [], RuntimeException
FullyQualifiedErrorId : VariableIsUndefined
You cannot call a method on a null-valued expression.
At \corp\root\home\steffanr\My Documents\WindowsPowerShell\Modules\PowerTab\TabExpansionLib.ps1:1318 char:50
$dsTabExpansionConfig.Tables['Config'].Select <<<< ("Category = 'Global'") | Where-Object {$_.Name -ne "Enabled"}
| ForEach-Object {
CategoryInfo : InvalidOperation: (Select:String) [], RuntimeException
FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At \corp\root\home\steffanr\My Documents\WindowsPowerShell\Modules\PowerTab\TabExpansionLib.ps1:1336 char:50
$dsTabExpansionConfig.Tables['Config'].Select <<<< ("Category = 'Colors'") | Foreach-Object {
CategoryInfo : InvalidOperation: (Select:String) [], RuntimeException
FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At \corp\root\home\steffanr\My Documents\WindowsPowerShell\Modules\PowerTab\TabExpansionLib.ps1:1347 char:50
$dsTabExpansionConfig.Tables['Config'].Select <<<< ("Category = 'ShortcutChars'") | Foreach-Object {
CategoryInfo : InvalidOperation: (Select:String) [], RuntimeException
FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At \corp\root\home\steffanr\My Documents\WindowsPowerShell\Modules\PowerTab\TabExpansionLib.ps1:1358 char:50
$dsTabExpansionConfig.Tables['Config'].Select <<<< ("Category = 'Setup'") | Foreach-Object {
CategoryInfo : InvalidOperation: (Select:String) [], RuntimeException
FullyQualifiedErrorId : InvokeMethodOnNull
WARNING: You cannot call a method on a null-valued expression.
Property 'ShowBanner' cannot be found on this object. Make sure that it exists.
At \corp\root\home\steffanr\My Documents\WindowsPowerShell\Modules\PowerTab\PowerTab.psm1:215 char:21
if ($PowerTabConfig. <<<< ShowBanner) {
CategoryInfo : InvalidOperation: (.:OperatorToken) [], RuntimeException
FullyQualifiedErrorId : PropertyNotFoundStrict
VERBOSE: Exporting function 'Invoke-TabExpansion'.
VERBOSE: Exporting function 'New-TabItem'.
VERBOSE: Exporting function 'New-TabExpansionDatabase'.
VERBOSE: Exporting function 'New-TabExpansionConfig'.
VERBOSE: Exporting function 'Import-TabExpansionDataBase'.
VERBOSE: Exporting function 'Export-TabExpansionDatabase'.
VERBOSE: Exporting function 'Import-TabExpansionConfig'.
VERBOSE: Exporting function 'Export-TabExpansionConfig'.
VERBOSE: Exporting function 'Import-TabExpansionTheme'.
VERBOSE: Exporting function 'Export-TabExpansionTheme'.
VERBOSE: Exporting function 'Update-TabExpansionDataBase'.
VERBOSE: Exporting function 'Update-TabExpansionType'.
VERBOSE: Exporting function 'Add-TabExpansionType'.
VERBOSE: Exporting function 'Update-TabExpansionWmi'.
VERBOSE: Exporting function 'Update-TabExpansionCom'.
VERBOSE: Exporting function 'Add-TabExpansionComputer'.
VERBOSE: Exporting function 'Remove-TabExpansionComputer'.
VERBOSE: Exporting function 'Get-TabExpansion'.
VERBOSE: Exporting function 'Add-TabExpansion'.
VERBOSE: Exporting function 'Remove-TabExpansion'.
VERBOSE: Exporting function 'Invoke-TabExpansionEditor'.
VERBOSE: Exporting function 'Register-TabExpansion'.
VERBOSE: Exporting function 'Resolve-TabExpansionParameterValue'.
VERBOSE: Exporting variable 'PowerTabConfig'.
VERBOSE: Exporting variable 'PowerTabError'.
VERBOSE: Exporting alias 'udte'.
VERBOSE: Exporting alias 'gte'.
VERBOSE: Exporting alias 'ate'.
VERBOSE: Exporting alias 'rte'.
VERBOSE: Exporting alias 'itee'.
VERBOSE: Exporting alias 'rgte'.
VERBOSE: Importing function 'Add-TabExpansion'.
VERBOSE: Importing function 'Add-TabExpansionComputer'.
VERBOSE: Importing function 'Add-TabExpansionType'.
VERBOSE: Importing function 'Export-TabExpansionConfig'.
VERBOSE: Importing function 'Export-TabExpansionDatabase'.
VERBOSE: Importing function 'Export-TabExpansionTheme'.
VERBOSE: Importing function 'Get-TabExpansion'.
VERBOSE: Importing function 'Import-TabExpansionConfig'.
VERBOSE: Importing function 'Import-TabExpansionDataBase'.
VERBOSE: Importing function 'Import-TabExpansionTheme'.
VERBOSE: Importing function 'Invoke-TabExpansion'.
VERBOSE: Importing function 'Invoke-TabExpansionEditor'.
VERBOSE: Importing function 'New-TabExpansionConfig'.
VERBOSE: Importing function 'New-TabExpansionDatabase'.
VERBOSE: Importing function 'New-TabItem'.
VERBOSE: Importing function 'Register-TabExpansion'.
VERBOSE: Importing function 'Remove-TabExpansion'.
VERBOSE: Importing function 'Remove-TabExpansionComputer'.
VERBOSE: Importing function 'Resolve-TabExpansionParameterValue'.
VERBOSE: Importing function 'Update-TabExpansionCom'.
VERBOSE: Importing function 'Update-TabExpansionDataBase'.
VERBOSE: Importing function 'Update-TabExpansionType'.
VERBOSE: Importing function 'Update-TabExpansionWmi'.
VERBOSE: Importing variable 'PowerTabConfig'.
VERBOSE: Importing variable 'PowerTabError'.
VERBOSE: Importing alias 'ate'.
VERBOSE: Importing alias 'gte'.
VERBOSE: Importing alias 'itee'.
VERBOSE: Importing alias 'rgte'.
VERBOSE: Importing alias 'rte'.
VERBOSE: Importing alias 'udte'.
Please advise!
Originally reported on CodePlex by anorhoads.
I know PowerTab has a whole bunch of magical characters that cause it to tab complete differently, but I don't know (or can't remember) what they all are. I think that's about_PowerTab_usage (is everything in there?)
In any case, you should put that information in your documentation wiki here, and link it on the front page, there's a ton of functionality in there that's hidden away (eg: #nn to tab complete the nnth item from history).
Originally reported on CodePlex by Jaykul.
At
C:\Users\jarcher\Documents\WindowsPowerShell\Modules\PowerTab\TabExpansionCore.ps1:279 char:60
I have some scripts that normally show up in tab completion, but don't show up in Get-Command . I think externalscript needs to be added to have it get those as well. I'll probably look at it a little later and see if I can find it.
Originally reported on CodePlex by StephenMills.
I follow the steps to install PowerTab. After installation completed, I check the file "PowerTabConfig.xml" in folder “F:\MyPowerShell\Module\PowerTab\Config”, but it isn't exist.
More info:
PS C:\Documents and Settings\Administrator> Import-Module PowerTab
Launch the setup wizard to create a PowerTab configuration file and database?
PowerTab can be setup manually without the setup wizard.
[N] No [Y] Yes [?] 帮助 (默认值为“Y”): y
Where should the PowerTab configuration file and database be saved?
Any existing PowerTab configuration will be overwritten.
[P] Profile Directory [I] Installation Directory [A] Application Data Directory [S] Isolated Storage
[O] Other Directory[?] 帮助 (默认值为“P”): o
Enter the directory path for storing the PowerTab configuration file and database: F:\MyPowerShell\Module\PowerTab\Config
Add the following text to the PowerShell profile to launch PowerTab with the saved configuration.
<############### Start of PowerTab Initialization Code ########################
Added to profile by PowerTab setup for loading of custom tab expansion.
Import other modules after this, they may contain PowerTab integration.
>
Import-Module "PowerTab" -ArgumentList "F:\MyPowerShell\Module\PowerTab\Config\PowerTabConfig.xml"
End of PowerTab Initialization Code
Update .NET type list in tab completion database from currently loaded types?
Loading .NET types.
[Y] 是(Y) [A] 全是(A) [N] 否(N) [L] 全否(L) [S] 挂起(S) [?] 帮助 (默认值为“Y”): y
Originally reported on CodePlex by lanmo1945.
Though http://powertab.codeplex.com/wikipage?title=Tab%20Item%20Selectors#ConsoleList_keymap says that SHIFT-TAB cause the selection to move up, nothing seems to be working.
PowerTab doesn't really understand lists that don't have spaces. This doesn't work right:
Get-Command -CommandType Alias,F<TAB>
This does:
Get-Command -CommandType Alias, F<TAB>
Adding a history for Powertab would help with generating unit tests and finding bugs. Have an exported variable like $PowerTabStatus
with a property of History ($PowerTabStatus.History
). I would think a few properties would be useful: Line, LastWord, CurrentDirectory, TabList (list of choices returned to PowerShell), and Time (when it was run).
Originally reported on CodePlex by StephenMills.
The core handler should preempt the FileSystem expansion if the last word matches one of the regex cases in the switch.
When invoking a tab request, it looks like the progress bar is hanging.
PowerTab can show method syntax already, it would be nice to support constructor arguments for New-Object.
If you specify Set-StrictMode -Version Latest in your profile and than try to Import-Module PowerTab, the Tab would not work.
PowerShell with PowerTab matches from the beginning of the string whereas default shell behavior is matching against any part of the string.
A quote from the PowerShell In Action book:
"A new feature was added to allow you to do tab completion against the command history. To recall the first command containing the string “abc”, type the # sign, followed by the pattern of the command you want to find, and then press the Tab key:
PS (4) > #abc
This will expand the command line to
PS (4) > $a="abcde"
"
E.g. consider having a command history item:
Get-Process
Without PowerTab:
PS> # Proc
-> matches
With PowerTab:
PS> # Proc
-> doesn't match
I made a tiny code edit to restore the default behavior:
Modules\PowerTab\TabExpansionCore.ps1:
-Get-History -Count 32767 | Where-Object {$.CommandLine -like "$Pattern*"} | Sort Id -Descending |
+Get-History -Count 32767 | Where-Object {$.CommandLine -like "$Pattern"} | Sort Id -Descending |
Originally reported on Codeplex by djet
It would be nice to paste the clipboard (and replace) with the pattern "^V" (CTRL-V).
dir e:
becomes
dir .\builds
Get-Module -list ## does not work
Get-Module - ## does show up in list
Mostly the parameters Breakpoint, Command, and Line.
Need to hide or replace this Windows only code.
Reference:
cspotcode/PS-GuiCompletion@a064031#diff-02db2b55ca88ecc2cd15b9aba683c388
What more needs to be said?
It would be nice to display dynamic parameters where they are available.
PowerTab uses "Dummy" entries in the tab expansion database as placeholders for namespaces, but these show up when using "t_" to get a type name with the grid view.
I'm having a few display issues using PowerTab through PowerShell.exe.
When scrolling down for a while and then back up, occasionally "]" characters remain at the end of the status message, and sometimes the lines of text get offset by one character, as the attached screenshot demonstrates.
Also, when I press "Escape" to leave the tab expansion menu, pressing "Tab" again does not show the menu again. (This may be expected behavior; I am uncertain.)
Thanks for any help!
Originally reported on CodePlex by dennisfile.
If you try to tab complete the members of a scriptblock that is stored in a variable, you will get an error.
$sb = {}
$sb.<TAB>
Error is from TabExpansionCore.ps1:548.
If I have an alias to a script file, I can't see the alias or the script through PowerTab. However, once it is typed in, I can get the parameters for it.
'param( [parameter()]$a) $a' > c:\temp\Get-TestScript.ps1
New-Alias Get-TestScript c:\temp\Get-TestScript.ps1
Get-TestS
Results:
Expected: Get-TestScript
Looks like a simple modification in TabExpansionCore.ps1 to get it to work. In the "## Functions or cmdlets on dash" section with the Get-Command add "Alias" to the CommandType parameter.
Originally reported by StephenMills
I have a fairly complicated profile script, but PowerTab is currently the second-to-last command in it. However, whenever I start up PowerShell, I get a useless and annoying tab completion window that displays Set-Location and Set-LocationEx; I generally have to type some gibberish, hit Tab, and then Esc a few times to get rid of it.
What's up with this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.