Windows Vista Forums

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


    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

  2. #2


    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

    > 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

  3. #3


    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

    > 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

    >> 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

  4. #4


    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

  5. #5


    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:

    > 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

  6. #6


    Hal Rottenberg Guest

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

    Karl Prosser[MVP] wrote:

    > 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.

    > 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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Quest AD cmdlet -what is the cmdlet to remove computer object IT Staff PowerShell 2 30 Oct 2008
Invoking Cmdlet Get-Location from cmdlet,cant get Currnt Directory Vikram PowerShell 2 05 Jun 2008
Whether a cmdlet derives from cmdlet or pscmdlet Marco Shaw PowerShell 1 19 Sep 2007
Invoking a cmdlet from another cmdlet Marco Shaw PowerShell 2 19 Sep 2007
Invoke Cmdlet from a Cmdlet =?Utf-8?B?ZnV6enkzMzM=?= PowerShell 3 25 Aug 2006