-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify that not providing a -ParameterName
argument implies the -Native
switch
#11248
Labels
Comments
5 tasks
I would additionally consider to remove the switch Register-ArgumentCompleter
-CommandName <String[]>
-ScriptBlock <ScriptBlock>
[<CommonParameters>] ... , nonetheless, already leads to the script block parameters as described for Register-ArgumentCompleter
[-CommandName <String[]>]
-ParameterName <String>
-ScriptBlock <ScriptBlock>
[<CommonParameters>] ..., |
michaeltlombardi
added
area-core
Area - Microsoft.PowerShell.Core module
issue-doc-bug
Issue - error in documentation
and removed
needs-triage
Waiting - Needs triage
labels
Jul 10, 2024
michaeltlombardi
added a commit
to michaeltlombardi/PowerShell-Docs
that referenced
this issue
Jul 10, 2024
…ter` parameters Prior to this change, the `Register-ArgumentCompleter` reference didn't indicate that specifying the **CommandName** parameter without the **ParameterName** or **Native** parameters causes the command to behave as if the user specified the `-Native` switch. This change: - Clarifies that users should always specify the **ParameterName** parameter when registering an argument completer for a PowerShell command. - Resolves MicrosoftDocs#11248 - Fixes AB#281953
4 tasks
michaeltlombardi
added a commit
to michaeltlombardi/PowerShell-Docs
that referenced
this issue
Jul 10, 2024
…ter` parameters Prior to this change, the `Register-ArgumentCompleter` reference didn't indicate that specifying the **CommandName** parameter without the **ParameterName** or **Native** parameters causes the command to behave as if the user specified the `-Native` switch. This change: - Clarifies that users should always specify the **ParameterName** parameter when registering an argument completer for a PowerShell command. - Resolves MicrosoftDocs#11248 - Fixes AB#281953
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Type of issue
Missing information
Feedback
Register-ArgumentCompleter
's parameter design is unusual in that a switch (-Native
) is situationally implied (whereas switch parameters normally require opt-in).It's worth mentioning that when a
-ParameterName
argument is (possibly accidentally) not supplied,-Native
is implied, which fundamentally changes the arguments passed to the-ScriptBlock
argument and can therefore cause confusion; see:Page URL
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/register-argumentcompleter?view=powershell-7.4
Content source URL
https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/7.4/Microsoft.PowerShell.Core/Register-ArgumentCompleter.md
Author
@sdwheeler
Document Id
e471c27f-aa83-321f-541f-878442638e1b
The text was updated successfully, but these errors were encountered: