Skip to content

Can we hide obsolete or internal-use-only helper parameters from syntax diagrams? #7868

Closed

Description

Format-Hex's -Raw switch is obsolete in PowerShell Core - it has no effect whatsoever and is only retained for backward compatibility with Windows PowerShell v5.1 (backstory here).

(As an aside: This fact is not documented, nor was the parameter's (fairly obscure) original purpose ever documented for v5.1.)

Explaining the obsolescence in the documentation will go a long way, but I wonder if there is/should be a mechanism to hide a parameter from the syntax diagram, so that its continued, pointless presence doesn't cause confusion / isn't a distraction when you run Format-Hex -? or Get-Command Format-Hex -Syntax, for instance.

The ability to hide parameters would in general also be useful for helper parameters that are solely meant to be used by a given cmdlet itself in recursive invocations, for instance.

Environment data

Written as of:

PowerShell Core 6.1.0

Activity

  1. vexx32 commented on Sep 26, 2018

    @vexx32
    Collaborator

    Something fairly simple should be in place for this. An [Obsolete()] parameter attribute, perhaps?

  2. iSazonov commented on Sep 27, 2018

    @iSazonov
    Collaborator

    I'll try it today.

    For reference #3320

    •After a discussion with Francisco Gamino (@Francisco-Gamino) and Joey Aiello (@joeyaiello), it was decided to make the Raw parameter No-op. Going forward all of the output will be displayed with a true representation of numbers that includes all of the bytes for its type (what the Raw parameter was formally doing). For example, [Int32]170 passed to Format-Hex would have previously displayed only "AA". Now it will display "AA 00 00 00".

  3. mklement0 commented on Sep 28, 2018

    @mklement0
    ContributorAuthor

    Thanks for taking this on, Ilya (@iSazonov).

    What, specifically, will the effects of using System.ObsoleteAttribute be to PowerShell users?
    Will it hide the parameter from the syntax diagrams, as suggested?

  4. iSazonov commented on Sep 28, 2018

    @iSazonov
    Collaborator

    #7877 doesn't hide the parameter from the syntax diagrams. If #7877 will be accepted it will allow to resolve the issue on next step.

  5. changed the title [-]Can we hide obsolete parameters from syntax diagrams?[/-] [+]Can we hide obsolete or internal-use-only helper parameters from syntax diagrams?[/+] on Apr 27, 2023
  6. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  7. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  8. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  9. microsoft-github-policy-service commented on Nov 23, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Resolution-No ActivityIssue has had no activity for 6 months or moreWG-Cmdletsgeneral cmdlet issues

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions