Commands/Lexicons/com/atproto/moderation/Get-AtProtoModerationDefinition.ps1
function Get-AtProtoModerationDefinition { [Alias('atproto.moderation.defs','com.atproto.moderation.defs','com.atproto.moderation.defs#reasonType','com.atproto.moderation.defs#reasonSpam','com.atproto.moderation.defs#reasonViolation','com.atproto.moderation.defs#reasonMisleading','com.atproto.moderation.defs#reasonSexual','com.atproto.moderation.defs#reasonRude','com.atproto.moderation.defs#reasonOther')] param( ) $lexiconText = @' { "lexicon": 1, "id": "com.atproto.moderation.defs", "defs": { "reasonType": { "type": "string", "knownValues": [ "com.atproto.moderation.defs#reasonSpam", "com.atproto.moderation.defs#reasonViolation", "com.atproto.moderation.defs#reasonMisleading", "com.atproto.moderation.defs#reasonSexual", "com.atproto.moderation.defs#reasonRude", "com.atproto.moderation.defs#reasonOther" ] }, "reasonSpam": { "type": "token", "description": "Spam: frequent unwanted promotion, replies, mentions" }, "reasonViolation": { "type": "token", "description": "Direct violation of server rules, laws, terms of service" }, "reasonMisleading": { "type": "token", "description": "Misleading identity, affiliation, or content" }, "reasonSexual": { "type": "token", "description": "Unwanted or mislabeled sexual content" }, "reasonRude": { "type": "token", "description": "Rude, harassing, explicit, or otherwise unwelcoming behavior" }, "reasonOther": { "type": "token", "description": "Other: reports not falling under another report category" } } } '@ $lexicon = $lexiconText | ConvertFrom-JSON if ($myInvocation.InvocationName -eq $myInvocation.MyCommand.Name) { $lexicon } elseif ($myInvocation.InvocationName -like '*#*') { $lexicon.defs.$(@($myInvocation.InvocationName -split '\#',2)[1]) } else { $lexicon } } |