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

about_Functions_Advanced_Parameters is missing some useful attributes #10136

Closed
3 tasks done
michaeltlombardi opened this issue Jun 5, 2023 · 0 comments · Fixed by #10198
Closed
3 tasks done

about_Functions_Advanced_Parameters is missing some useful attributes #10136

michaeltlombardi opened this issue Jun 5, 2023 · 0 comments · Fixed by #10198
Assignees
Labels
area-about Area - About_ topics area-core Area - Microsoft.PowerShell.Core module issue-doc-bug Issue - error in documentation

Comments

@michaeltlombardi
Copy link
Contributor

michaeltlombardi commented Jun 5, 2023

Prerequisites

  • Existing Issue: Search the existing issues for this repository. If there is an issue that fits your needs do not file a new one. Subscribe, react, or comment on that issue instead.
  • Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Typo in Get-Foo cmdlet" instead of "Typo."
  • Verify Version: If there is a mismatch between documentation and the behavior on your system, ensure that the version you are using is the same as the documentation. Check this box if they match or the issue you are reporting is not version specific.

Links

Summary

The about_Functions_Advanced_Parameters article includes documentation for several useful attributes you can use on parameters in PowerShell. It either documents them directly or gives an overview and links to further documentation for them.

However, the following useful attributes aren't mentioned:

Details

The PSDefaultValue attribute is partially documented in about_Functions at the end of the Named Parameters section and more documented in 12.3.8 The PSDefaultValue attribute of the language specification. Neither is very discoverable.

The Credential attribute is documented in the Credential Attribute Declaration article in the SDK docs. Unfortunately, this isn't very discoverable.

The Experimental attribute is documented in about_Experimental_Features.

The PSTypeName attribute isn't mentioned in the documentation, but it's useful for script and module authors when working with custom objects and decorated types.

The System.Obsolete attribute isn't mentioned in the documentation, but it's useful for script and module authors to mark a parameter as obsolete before removing it.

Suggested Fix

Update about_Functions_Advanced_Parameters to document these attributes and include examples of their usage.

@michaeltlombardi michaeltlombardi added area-core Area - Microsoft.PowerShell.Core module area-about Area - About_ topics issue-doc-bug Issue - error in documentation labels Jun 5, 2023
@sdwheeler sdwheeler self-assigned this Jun 22, 2023
michaeltlombardi added a commit that referenced this issue Jun 23, 2023
)

* Add missing parameter attributes & fix formatting

* Fix typo

* Remove experimental attribute from 5.1 docs

* Apply suggestions from code review

Co-authored-by: Mikey Lombardi (He/Him) <michael.t.lombardi@gmail.com>

* Feedback suggestions

---------

Co-authored-by: Mikey Lombardi (He/Him) <michael.t.lombardi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-about Area - About_ topics area-core Area - Microsoft.PowerShell.Core module issue-doc-bug Issue - error in documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants