Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

GetCustomAttributes fails to retrieve CmdletAttribute with ConfirmImpact property #1252

Copy link
Copy link
@JamesWTruher

Description

@JamesWTruher
Issue body actions

Steps to reproduce

[System.Management.Automation.Cmdlet("Get", "Thing", ConfirmImpact = 'High', SupportsPaging = $true)]class C2{}
$t = [C2].GetCustomAttributes($false)
$t

From Scripting.Classes.Basic.Parsing.Tests.ps1

Expected behavior

NounName                : Thing
VerbName                : Get
DefaultParameterSetName :
SupportsShouldProcess   : False
SupportsPaging          : True
SupportsTransactions    : False
ConfirmImpact           : High
HelpUri                 :
RemotingCapability      : PowerShell
TypeId                  : System.Management.Automation.CmdletAttribute

Actual behavior

Exception calling "GetCustomAttributes" with "1" argument(s): "'ConfirmImpact' property specified was not found."
At line:1 char:9
+         $t = [C2].GetCustomAttributes($false)
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : CustomAttributeFormatException

Environment data

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.10032.0
PSEdition                      Linux
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   3.0.0.0
GitCommitId                    v0.5.0-217-g9c9161febac5fc433d1987e75d8ba9b18fd286c1
CLRVersion
WSManStackVersion              1.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Blockedblocked on something external to this repoblocked on something external to this repoIssue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtimeWG-Maintainers-Buildspecific to affecting the buildspecific to affecting the build

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.