Steps to reproduce
function fn {
[CmdletBinding(DefaultParameterSetName = "A")]
param(
[Parameter(Mandatory, Position = 0, ParameterSetName = "B")]
[Hashtable]
$B,
[Parameter(Mandatory, Position = 0, ParameterSetName = "A")]
[ArgumentCompleter({"test"})]
[string]
$A
)
}
Now type fn in the prompt and press the Tab key.
Expected behavior
In PowerShell 7.3.3 and and earlier versions, the argument completer for $A is invoked and the command is autocompleted to fn test, because $A is the only parameter with Position=0 and a compatible type.
Actual behavior
In PowerShell 4.1.0-preview.1, the argument completer for $A is not invoked, and the generic path autocompletion appears instead. However, when the input is changed to fn t and then Tab is pressed, the completer is correctly invoked and completes the input to fn test.
Environment data
Name Value
---- -----
PSVersion 7.4.0-preview.1
PSEdition Core
GitCommitId 7.4.0-preview.1
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Steps to reproduce
Now type
fnin the prompt and press the Tab key.Expected behavior
In PowerShell 7.3.3 and and earlier versions, the argument completer for
$Ais invoked and the command is autocompleted tofn test, because$Ais the only parameter withPosition=0and a compatible type.Actual behavior
In PowerShell 4.1.0-preview.1, the argument completer for
$Ais not invoked, and the generic path autocompletion appears instead. However, when the input is changed tofn tand then Tab is pressed, the completer is correctly invoked and completes the input tofn test.Environment data