Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

help repro this possible posh bug? tab completion with cmdlet andfunction conflicts

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 01-22-2008   #1 (permalink)
Hal Rottenberg
Guest


 

help repro this possible posh bug? tab completion with cmdlet andfunction conflicts

Someone help me confirm this posh bug? Create a function of the same name as a
cmdlet, the function must have at least one parameter. See if you can tab
complete on the function's params. Of course you should be able to because
functions have higher execution priority than cmdlets, but it doesn't work that
way for me.

I thought it was a bug of PS+, they thought it might be a PowerTab bug, but now
I think it might be powershell itself.

--

Hal Rottenberg
Blog: http://halr9000.com
Webmaster, Psi (http://psi-im.org)
Co-host, PowerScripting Podcast (http://powerscripting.net)

My System SpecsSystem Spec
Old 01-22-2008   #2 (permalink)
Shay Levi
Guest


 

Re: help repro this possible posh bug? tab completion with cmdlet andfunction conflicts

PowerShell doesn't complete the parameter.
When I enable PowerTAB, the parameter name appears is in the autocomplete
list as if it belongs to
the *original* cmdlet parameters.

-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
Quote:

> Someone help me confirm this posh bug? Create a function of the same
> name as a cmdlet, the function must have at least one parameter. See
> if you can tab complete on the function's params. Of course you
> should be able to because functions have higher execution priority
> than cmdlets, but it doesn't work that way for me.
>
> I thought it was a bug of PS+, they thought it might be a PowerTab
> bug, but now I think it might be powershell itself.
>

My System SpecsSystem Spec
Old 01-22-2008   #3 (permalink)
Shay Levi
Guest


 

Re: help repro this possible posh bug? tab completion with cmdlet andfunction conflicts

Hal

I checked it on another machine (v1), even if the function is not named after
an exisiting cmdlet
there is no tab completion for parameters.

-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
Quote:

> PowerShell doesn't complete the parameter.
> When I enable PowerTAB, the parameter name appears is in the
> autocomplete
> list as if it belongs to
> the *original* cmdlet parameters.
> -----
> Shay Levi
> $cript Fanatic
> http://scriptolog.blogspot.com
Quote:

>> Someone help me confirm this posh bug? Create a function of the same
>> name as a cmdlet, the function must have at least one parameter. See
>> if you can tab complete on the function's params. Of course you
>> should be able to because functions have higher execution priority
>> than cmdlets, but it doesn't work that way for me.
>>
>> I thought it was a bug of PS+, they thought it might be a PowerTab
>> bug, but now I think it might be powershell itself.
>>

My System SpecsSystem Spec
Old 01-22-2008   #4 (permalink)
Hal Rottenberg
Guest


 

[bug filed] tab completion with cmdlet and function conflicts

Thanks for confirming, Shay.

The connect bug report is:
https://connect.microsoft.com/feedba...3468&SiteID=99

--

Hal Rottenberg
Blog: http://halr9000.com
Webmaster, Psi (http://psi-im.org)
Co-host, PowerScripting Podcast (http://powerscripting.net)
My System SpecsSystem Spec
Old 01-22-2008   #5 (permalink)
Karl Prosser[MVP]
Guest


 

Re: help repro this possible posh bug? tab completion with cmdletand function conflicts

A little bit of background.

1) Powershell default tabexpansion logic doesn't have function parameter
expansion. This is something that Mow added in Powertab, where he
manually parses a functions definition from its scriptblock.

2) in powershell.exe you'll see the tabexpansion function doesn't even
contain cmdlet logic..

this is because doing a get-command each time is expensive and unneeded
when the host already knows the cmdlets loaded.. so powershell.exe
internally deals with a few tab expansion scenarios, namely CMDLETs and
provider (file system/registry etc) expanision.. then offloads the rest
of the scenarios to the tabexpansion function.

Some versions of Powertab (not sure about hte current) also override the
build in cmdlet expansion (so that mow can provide his console based
selection "windows" ).

In powershell plus , we also manually deal with cmdlets and file
expansion, but also a number of other things such as $_, before passing
it off to tabexpansion..

-Karl

Hal Rottenberg wrote:
Quote:

> Someone help me confirm this posh bug? Create a function of the same
> name as a cmdlet, the function must have at least one parameter. See if
> you can tab complete on the function's params. Of course you should be
> able to because functions have higher execution priority than cmdlets,
> but it doesn't work that way for me.
>
> I thought it was a bug of PS+, they thought it might be a PowerTab bug,
> but now I think it might be powershell itself.
>
My System SpecsSystem Spec
Old 01-22-2008   #6 (permalink)
Hal Rottenberg
Guest


 

Re: help repro this possible posh bug? tab completion with cmdletand function conflicts

Karl Prosser[MVP] wrote:
Quote:

> 1) Powershell default tabexpansion logic doesn't have function parameter
> expansion. This is something that Mow added in Powertab, where he
> manually parses a functions definition from its scriptblock.
Ahhh....I guess I need to retract my posh bug then and change it to mow bug.
Quote:

> In powershell plus , we also manually deal with cmdlets and file
> expansion, but also a number of other things such as $_, before passing
> it off to tabexpansion..
Do I need to update the bug I filed with you or does this thread suffice?

--

Hal Rottenberg
Blog: http://halr9000.com
Webmaster, Psi (http://psi-im.org)
Co-host, PowerScripting Podcast (http://powerscripting.net)
My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Invoking Cmdlet Get-Location from cmdlet,cant get Currnt Directory Vikram PowerShell 2 06-05-2008 04:41 AM
Whether a cmdlet derives from cmdlet or pscmdlet Marco Shaw PowerShell 1 09-19-2007 09:18 PM
Invoking a cmdlet from another cmdlet Marco Shaw PowerShell 2 09-19-2007 12:46 PM
Conflicts?? =?Utf-8?B?Q3JhenkgUmV2?= Vista hardware & devices 0 09-21-2006 02:56 PM
Invoke Cmdlet from a Cmdlet =?Utf-8?B?ZnV6enkzMzM=?= PowerShell 3 08-25-2006 07:49 AM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51