-
Couldn't load subscription status.
- Fork 8k
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Interactive-IntelliSensetab completiontab completion
Description
Steps to reproduce
Simple Steps:
Remove-Alias "cd"
get-Command "cd" # -> error, remove-alias was successful
cd <ctrl-space> # still shows completionsEnhanced Steps:
Remove-Alias "cd"
Function Invoke-CdAlternative {
[cmdletbinding()]
param(
[string]$ToPrint
)
Write-Host "cdAlternative print argument: $($ToPrint)"
}
Register-ArgumentCompleter -CommandName Invoke-CdAlternative -ParameterName ToPrint -ScriptBlock {
"foo", "bar" `
| ForEach-Object {
[System.Management.Automation.CompletionResult]::new($_, $_, "ParameterValue", $_)
}
}
Invoke-CdAlternative <ctrl-space> # successfully extends arguments
new-alias -name "cd" -Value "Invoke-CdAlternative"
cd <ctrl-space> # still shows completions for original cd alias
# on the other hand
new-alias -name "mycdalternative" -Value "Invoke-CdAlternative"
mycdalternative <ctrl-space> # shows the defined completions for invoke-cdalternativeExpected behavior
from Simple Steps
cd <ctrl-space> # shows default completions, all files in current folder?from Enhanced Steps
cd <ctrl-space> # shows completions from ArgumentCompleter like the following does:
mycdalternative <ctrl-space>Environment data
Name Value
---- -----
PSVersion 7.0.0
PSEdition Core
GitCommitId 7.0.0
OS Microsoft Windows 10.0.17763
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Interactive-IntelliSensetab completiontab completion