Because of this issue, it's not possible to provide completion for native command parameters.
Inputs that repro the issue for command 'foo' (i.e. do not invoke completion):
Inputs that do not repro the issue:
The issue repros with and without PSReadLine.
Register a new argument completer
Register-ArgumentCompleter -Native -CommandName foo -ScriptBlock { "bar" }
Type 'foo -\
'foo -' completes to 'foo bar'
The text does not change
> $PSVersionTable
Name Value
---- -----
PSRemotingProtocolVersion 2.3
CLRVersion
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
GitCommitId v6.0.0-alpha.14
PSVersion 6.0.0-alpha
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSEdition Core
BuildVersion 3.0.0.0
Odd - this works with TabExpansionPlusPlus which defines roughly the same command and in theory works in a similar way, but it doesn't work with the built-in cmdlet.
Can somebody apply the "Consider-WindowsPowerShell51" label to this issue? As written in PowerShell/PowerShell-Docs#1979, there is a same issue in Windows PowerShell 5.1.
It seems like that inpus start with - still doen't get any completion now.
Is this issue fixed?
This is still an issue in PowerShell 5.1, it's only been fixed in PowerShell Core. Should this be re-opened for 5.1, or should we create a new issue? @iSazonov
PS 5.1 is not being maintained excepting for critical security issues.
All development/bugfix efforts are focused on PS 7+.
@vexx32 Thanks, I'm sorry to hear that but it's good to know.