Add to Technorati Favorites
Welcome to ThePowerShellGuy.com Sign in | Join | Help

PowerTab Version 0.98 Released

 Powertab 0.98 is released ( Download it from the PowerTab Overview Page )

I have recieved some bug reports from users in the comments ( Thanks ! ) of the entry about PowerTab version 0.97 and made some other small fixes, but also 2 great new additions, an extension on the inline search for .net types more info below and I added a  Custom Function feature, I the next post I will show how to use the Custom function and some very cool usage scenarios for this Function.

 

New Features :

  • Inline Search works also for types now !

I changed Oisin's great Inline search added in PowerTab 0.97, to also support searching on .NET types, it works now after a [bracket also, making it also posible to use it when you not want to make an object but are using a .net type directly ,typing  an opening bracket [ and will powertab add a closing one at the end ] automaticly so you can now[System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() as easy as 7 key strokes :

PoSH> [.dom                                                                          
PoSH>      ╔═ .dom ══════════════════════════════════════════════════════════════╗   
PoSH>       System.DirectoryServices.ActiveDirectory.Domain                        
PoSH>       System.DirectoryServices.ActiveDirectory.DomainCollection              
PoSH>       System.DirectoryServices.ActiveDirectory.DomainCollisionOptions        
PoSH>       System.DirectoryServices.ActiveDirectory.DomainController              
PoSH>       System.DirectoryServices.ActiveDirectory.DomainControllerCollection    
PoSH>       System.DirectoryServices.ActiveDirectory.DomainMode                    
PoSH>       System.Windows.Forms.DomainUpDown                                      
PoSH>      ╚═[1] 1-7 (7/7)]══════════════════════════════════════════════════════╝   
PoSH> [System.DirectoryServices.ActiveDirectory.Domain]::g                           
PoSH>       ╔═ [System.DirectoryServices.ActiveDirectory.Domain]::g ════════════════╗
PoSH>        [System.DirectoryServices.ActiveDirectory.Domain]::GetComputerDomain( PoSH>        [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain(  PoSH>        [System.DirectoryServices.ActiveDirectory.Domain]::GetDomain(         PoSH>       ╚═[1] 1-3 (3/5)]════════════════════════════════════════════════════════╝
PoSH>                                                  

 

  • Custom User function added

this will enable you to let powertab call your own function with the last word as a parameter, the values returned by it will be shown in the tabcompletion list, this makes it possible to take any action you want on it.

New settings for this functionality are :

 

$PowerTabConfig.CustomFunctionEnabled
$PowerTabConfig.CustomUserFunction

PoSH> $PowerTabConfig.ShortcutChars.CustomFunction
#

this new CustomFunction needs to be configured and is disabled by default but we can do very cool things with it, as I will show in a follow-up post by adding language translation functions to PowerTab tabexpansion :

 

PoSH> hello#                                                                         
PoSH>       ╔═ hello ══════════╗                                                     
PoSH>        ¿sí?                                                                  
PoSH>        hola                                                                  
PoSH>       ╚═[1] 1-2 (2/2)]═══╝                                                     
PoSH> hello#                                                                         
PoSH>       ╔═ hello ══════════╗                                                     
PoSH>        hallo!                                                                
PoSH>        Hallo                                                                 
PoSH>        Gruß                                                                  
PoSH>        hallo rufen                                                           
PoSH>        hallo                                                                 
PoSH>       ╚═[1] 1-5 (5/5)]═══╝                                                     
                                                                               
PoSH> hello#                                                                         
PoSH>       ╔═ hello ══════════╗                                                     
PoSH>        allô                                                                  
PoSH>        bonjour                                                               
PoSH>       ╚═[1] 1-2 (2/2)]═══╝                                                     
PoSH>                                

 

Bug fixes :

 

SQL guru : some problems with directory completion using an UNC path (known error)

yes I did notice this also, Filesystem completion is very hard to do and I could not solve this yet,  as most of the time it works correctly and  the "normal" completion has some issues also, I still decided to add the filesystem completion. But I made it configurable so there is no need to revert to an old version for this reason you can change to "normal" filesystem expansion on-the-fly when needed to change back to normal completion by setting the following configuration parameter

$PowerTabConfig.FileSystemExpand = $false

 

Brimmer : I use %[tab]tabe and select say Import-TabExpansionTheme and hit enter, I get Foreach-Object instead... (changed behavour)

This was not really a bug but still unexpected behavour, when AliasQuickExpand is enabled % is resolved to foreach-object on [tab],

as this is also the default Partial completion character after the alias resolving also the list from the partial completion will be shown, when an item is choosen this will also be returned, but after foreach-object so you need to hit [tab] another time to select the choosen function.

this is very confusing so I made the following changes :

  1. I changed $powertab.AliasQuickExpand changed to  $False by default again, so this problem will not be there in standard installation
  2. Moved alias expansion after the shortcut completions, so foreach-object will be added after the selected item from list (extra tab for foreach-object now)

alias expansion is disabled by default as it can interfere with filesystem completion also, and it still can be done with the @ shortcut charater, so I think this default is better, as we also have a custom alias for foreach we can still complete it in 2 way's.

%@[tab] -> foreach-object

|%[tab]  -> | foreach {$_}

and as I moved the alias Quickcompletion after the shortcut completion it is placed after the list and will only be shown on esc. or another tab.

%[tab][esc]

%[tab][enter][tab]

I think this changes will make all scenarios for alias expansion workable again

 

Mark : Setup.cmd error as the PSCX extensions installed (and therefore a custom cd command).  and error on spaces in Path (fixed)

 

Thanks a lot for reporting these comments and bugs in Powertab in the comments, this is really helpfull and greatly appriciated !!

 

and I also found a bug myself :

  • BDD 2007 type information could not be added to Powertab anymore (Fixed)

I reintroduced the old bug again by accident with a former update , now BDD types will be updated correctly again see :  BDD 2007

 

 

Enjoy,

Greetings /\/\o\/\/

Published Wednesday, September 05, 2007 6:38 AM by MoW

Comments

# re: PowerTab Version 0.98 Released

I had forgotten about the % - ForEach-Object alias.  Thanks for the solution, keep up the good work.

Wednesday, September 05, 2007 12:48 PM by Brimmer

# re: PowerTab Version 0.98 Released

It looks like parameter completion doesn't work for functions, filters, aliases, or externalscripts.  I've only verified it for scripts.  The line where it's looking for them seems to be adding brackets for some reason.

$script = @(Get-Command -type 'Function,ExternalScript,alias' "[$($script.Insert(1,']'))")[0]

In changed it to the following and it seemed to work then.

$script = @(Get-Command -type 'Function,ExternalScript,alias' $script)[0]

Thanks!

Monday, September 10, 2007 4:55 PM by SQL_Guru

# PowerTab Version 0.98正式版发布了

PowerTab Version 0.98正式版发布了

Tuesday, September 11, 2007 7:18 AM by Edengundam

# Guion de las demos de la Webcast sobre PowerShell

Hola Lo dejo en este enlace . Gran parte del contenido está entresacado de las guías de referencia y

Thursday, September 13, 2007 7:29 PM by Microsoft, su tecnología y yo

# re: PowerTab Version 0.98 Released

@ SQL_Guru

fixed this for PowerTab 0.99

Needed some more work as [] workaround needed also .

you can find the pre-release beta here :

http://thepowershellguy.com/blogs/posh/pages/powertab-beta.aspx

Greetings /\/\o\/\/

Friday, September 21, 2007 11:53 PM by MoW

# Setup appears to be in an endless loop

First of all let me say that this addin looks incredible.  I watched the video about PS and they said that you have to install this.  So I downloaded it, but when I try to install it appears to be in an endless loop.  It keeps displaying the following error over and over:

Pick Powertab Configuration Location

Cannot convert argument "2", with value: "System.Object[]", for "PromptForChoice" to type "System.Collections.ObjectMod

el.Collection`1[System.Management.Automation.Host.ChoiceDescription]": "Cannot convert "System.Object[]" to "System.Col

lections.ObjectModel.Collection`1[System.Management.Automation.Host.ChoiceDescription]"."

At C:\Program Files\Windows PowerShell\v1.0\PowerTab\PowerTabSetup.ps1:116 char:37

+   $Answer = $host.ui.PromptForChoice( <<<< 'Pick location to store the Powertab Configuration database',"or choose Ot

her to provide custom location manual",$profileChoices,0)

Cannot convert argument "2", with value: "System.Object[]", for "PromptForChoice" to type "System.Collections.ObjectMod

el.Collection`1[System.Management.Automation.Host.ChoiceDescription]": "Cannot convert "System.Object[]" to "System.Col

lections.ObjectModel.Collection`1[System.Management.Automation.Host.ChoiceDescription]"."

At C:\Program Files\Windows PowerShell\v1.0\PowerTab\PowerTabSetup.ps1:116 char:37

+   $Answer = $host.ui.PromptForChoice( <<<< 'Pick location to store the Powertab Configuration database',"or choose Ot

her to provide custom location manual",$profileChoices,0)

How do I fix this so that it will install PT.

thanks,

Ken

Monday, October 01, 2007 6:19 PM by kenpro66

# Xenophane's Blog ?? PoSH add-on PowerTab

Tuesday, October 02, 2007 7:37 AM by Xenophane's Blog ?? PoSH add-on PowerTab

# Setup issues

Ok I got past the other error.  Now when the Init-TabExpansion.ps1 script runs I get the following error:

Missing ')' in method call.

At H:\PowerTab\Init-TabExpansion.ps1:60 char:62

+             "`$v = `$dsTabExpansion.Tables['Config'].Select("" <<<< Name = 'Enabled'"")[0]

To get past the other error I had to change all of the lines that had PromptForChoice to look like the following:

 $Answer = $host.ui.PromptForChoice('Pick location to store the Powertab Configuration database',"or choose Other to provide custom location manual",[System.Management.Automation.Host.ChoiceDescription[]]$profileChoices,(0))

For some reason PS is not seeing the $profileChoices as an array of ChoiceDescription.  After I force it to that type, this statement executes properly.

Could this have anything to do with the type of system that I am trying to install this on?  It is Windows XP Pro SP2.

Thanks,

Ken

Tuesday, October 02, 2007 2:34 PM by kenpro66

# Setup issues

I think that I got it all resolved.  I uninstalled PS and re-installed then installed PT over again.  All seems to working ok now.  Great addition.

thanks,

Ken

Tuesday, October 02, 2007 4:26 PM by kenpro66

# Language translation in PowerShell using PowerTab Part 1

In this 2 part series I will show how you can customize TabExpansion by adding your own functionality

Thursday, October 25, 2007 4:59 PM by The PowerShell Guy

# re: PowerTab Version 0.98 Released

Hi

FYI, I noticed that when I launch PowerShell and type $error I get this:

Windows PowerShell V2 (Community Technology Preview - Features Subject to Change)

Copyright (C) 2007 Microsoft Corporation. All rights reserved.

PowerTab version 0.98 PowerShell TabExpansion library

/\/\o\/\/ 2007 http://thePowerShellGuy.com

PowerTab Tabexpansion additions enabled : True

PS:1 >$error

Exception calling "Remove" with "1" argument(s): "Table Cache does not belong to this DataSet."

At C:\Scripts\PowerTab098\Init-TabExpansion.ps1:38 char:53

+ &{trap{continue}$global:dsTabExpansion.Tables.Remove <<<< ('Cache')}

-----

Shay Levi

$cript Fanatic

http://scriptolog.blogspot.com

Monday, December 24, 2007 8:15 AM by Shay

# How do you uninstall?

How do I uninstall Powertab?  I think I'm getting a conflict between it and PowerShell+.

I want to take this out of the equation to make sure that it's either a) the problem or b) something else has gone wrong.

Friday, February 29, 2008 4:21 PM by Bill_In_Racine

# re: PowerTab Version 0.98 Released

@ Bill,

Just in the toolbar select mode 1

Greetings /\/\o\/\/

Saturday, March 01, 2008 2:06 PM by MoW
Anonymous comments are disabled