![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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 Specs![]() |
| | #3 (permalink) |
| | 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 Specs![]() |
| | #4 (permalink) |
| | [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 Specs![]() |
| | #5 (permalink) |
| | 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 Specs![]() |
| | #6 (permalink) |
| | 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. ![]() 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.. ![]() -- Hal Rottenberg Blog: http://halr9000.com Webmaster, Psi (http://psi-im.org) Co-host, PowerScripting Podcast (http://powerscripting.net) |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Quest AD cmdlet -what is the cmdlet to remove computer object | PowerShell | |||
| Invoking Cmdlet Get-Location from cmdlet,cant get Currnt Directory | PowerShell | |||
| Whether a cmdlet derives from cmdlet or pscmdlet | PowerShell | |||
| Invoking a cmdlet from another cmdlet | PowerShell | |||
| Invoke Cmdlet from a Cmdlet | PowerShell | |||