Skip to content
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

Supress ProgressAction parameter from New-MarkdownHelp output #663

Open
chrisda opened this issue Jul 18, 2024 · 2 comments
Open

Supress ProgressAction parameter from New-MarkdownHelp output #663

chrisda opened this issue Jul 18, 2024 · 2 comments
Labels
Issue-Enhancement Issue is more of a feature request than a bug Needs-Triage The issue is new and needs to be triaged by a work group. platyps-0.14.2

Comments

@chrisda
Copy link

chrisda commented Jul 18, 2024

Summary of the new feature / enhancement

Typically, I run New-MarkdownHelp (v14.2) in PowerShell 5.1x. I recently had occasion to run it in PowerShell 7.4.3. When I did, every cmdlet got a new ProgressAction parameter. According to about_CommonParameters, ProgressAction is a common parameter like Debug or Verbose. Unclear why only that common parameter is getting added to cmdlet articles.

Proposed technical implementation details (optional)

ProgressAction doesn't need to appear in the output of New-MarkdownHelp. This issue might be similar to the AsJob parameter as described in #339 (although AsJob was related to remote PowerShell).

@chrisda chrisda added Issue-Enhancement Issue is more of a feature request than a bug Needs-Triage The issue is new and needs to be triaged by a work group. labels Jul 18, 2024
@soulshined
Copy link

I tried forking and building from source but was having issues getting it done. Anyways, re:

Unclear why only that common parameter is getting added to cmdlet articles

See:

function isCommonParameterName
{
param([string]$parameterName, [switch]$Workflow)
if (@(
'Verbose',
'Debug',
'ErrorAction',
'WarningAction',
'InformationAction',
'ErrorVariable',
'WarningVariable',
'InformationVariable',
'OutVariable',
'OutBuffer',
'PipelineVariable'
) -contains $parameterName) {
return $true

It's hard coded. Wouldn't something like this be future proof:

if ([System.Management.Automation.PSCmdlet]::CommonParameters.Contains($parameterName) -or
    [System.Management.Automation.PSCmdlet]::OptionalCommonParameters.Contains($parameterName)) {
       return true;
 }

@jdhitsolutions
Copy link

I believe this is being addressed in this PR I would love to get a new release with this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement Issue is more of a feature request than a bug Needs-Triage The issue is new and needs to be triaged by a work group. platyps-0.14.2
Projects
None yet
Development

No branches or pull requests

4 participants