Repository: PowerShell/PowerShell
File: src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs (C#)

Code before:
                            {
                                continue;
                            }
                            if (pattr.DontShow)
                            {
                                showToUser = false;
                                addCommonParameters = false;
                                break;
                            }

                            if (string.IsNullOrWhiteSpace(helpMessage))
                            {
                                helpMessage = GetParameterHelpMessage(pattr, commandAssembly);    
                            }
                        }
                    }

                    if (showToUser)
                    {
                        string completionText = "-" + name + colonSuffix;
                        string tooltip = string.IsNullOrWhiteSpace(helpMessage)
                            ? $"{type}{name}"
                            : $"{type}{name} - {helpMessage}";
                        listInUse.Add(new CompletionResult(completionText, name, CompletionResultType.ParameterName,
                                                           tooltip));
                    }
                }
                else if (parameterName != string.Empty)
                {
                    // Process alias when there is partial input
                    foreach (var alias in param.Parameter.Aliases)
                    {
                        if (pattern.IsMatch(alias))
                        {
                            listInUse.Add(new CompletionResult(
                                $"-{alias}{colonSuffix}",
                                alias,
                                CompletionResultType.ParameterName,
                                type + alias));
                        }
                    }
                }
            }

            // Add the common parameters to the results if expected.
            if (addCommonParameters)
            {
                result.AddRange(commonParamResult);
            }

            return result;

Review comment (suggestion):
```suggestion
                            if (helpMessage is null))
                            {
                                TryGetParameterHelpMessage(pattr, commandAssembly, out helpMessage);    
                            }
```

Code after:
                if (pattern.IsMatch(name))
                {
                    // Then using functions to back dynamic keywords, we don't necessarily
                    // want all of the parameters to be shown to the user. Those that are marked
                    // DontShow will not be displayed. Also, if any of the parameters have
                    // don't show set, we won't show any of the common parameters either.
                    bool showToUser = true;
                    var compiledAttributes = param.Parameter.CompiledAttributes;
                    if (compiledAttributes != null && compiledAttributes.Count > 0)
                    {
                        foreach (var attr in compiledAttributes)
                        {
                            if (attr is ParameterAttribute pattr)
                            {
                                if (pattr.DontShow)
                                {
                                    showToUser = false;
                                    addCommonParameters = false;
                                    break;
                                }
                                
                                if (helpMessage is null && TryGetParameterHelpMessage(pattr, commandAssembly, out string attrHelpMessage))
                                {
                                    helpMessage = $" - {attrHelpMessage}";
                                }
                            }
                        }
                    }

                    if (showToUser)
                    {
                        string completionText = $"-{name}{colonSuffix}";
                        string tooltip = $"{type}{name}{helpMessage}";
                        listInUse.Add(new CompletionResult(completionText, name, CompletionResultType.ParameterName,
                                                           tooltip));
                    }
                }
                else if (parameterName != string.Empty)
                {
                    // Process alias when there is partial input
                    foreach (var alias in param.Parameter.Aliases)
                    {
                        if (pattern.IsMatch(alias))
                        {
                            listInUse.Add(new CompletionResult(
                                $"-{alias}{colonSuffix}",
                                alias,
                                CompletionResultType.ParameterName,
                                type + alias));
                        }
                    }