I found an easy way to surface the attributes that are on properties of objects. If you update the MemberDefinition
type, you can expose them so they show up when you run Get-Member
.
Last active
March 27, 2022 00:36
-
-
Save Jaykul/e14600dd8caef3c44aff7a7bfcebe9ce to your computer and use it in GitHub Desktop.
Adding Attributes to Get-Member
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Update-TypeData -TypeName Microsoft.PowerShell.Commands.MemberDefinition ` | |
-MemberType ScriptProperty ` | |
-MemberName Attributes ` | |
-Value { ($this.TypeName -as [Type]).GetMember($this.Name).GetCustomAttributes($true) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment