Commands/Lexicons/app/bsky/actor/Get-BskyActorProfile.ps1
function Get-BskyActorProfile { <# .Synopsis app.bsky.actor.getProfile .Description app.bsky.actor.getProfile .Link https://github.com/bluesky-social/atproto/tree/main/lexicons/app/bsky/actor/getProfile.json #> [Alias('Get-BlueSkyActorProfile','bsky.actor.getProfile','app.bsky.actor.getProfile')] [CmdletBinding(SupportsShouldProcess)] param( <# The Actor. This can be either a handle (e.g. @AtProto.com) or a Decentralized Identifier (.did) #> [Parameter(Mandatory,ValueFromPipelineByPropertyName)] [ComponentModel.DefaultBindingProperty('actor')] [String] $Actor, # If set, will cache results for performance. [Management.Automation.SwitchParameter] $Cache ) begin { $NamespaceID = 'app.bsky.actor.getProfile' $httpMethod = 'GET' $InvokeAtSplat = [Ordered]@{Method=$httpMethod} $InvokeAtSplat["PSTypeName"] = $NamespaceID $parameterAliases = [Ordered]@{} $AsByte = $false :nextParameter foreach ($paramMetadata in ([Management.Automation.CommandMetadata]$MyInvocation.MyCommand).Parameters.Values) { foreach ($attr in $paramMetadata.Attributes) { if ($attr -is [ComponentModel.DefaultBindingPropertyAttribute]) { $parameterAliases[$paramMetadata.Name] = $attr.Name continue nextParameter } } } $parameterQueue = [Collections.Queue]::new() } process { $parameterQueue.Enqueue([Ordered]@{} + $PSBoundParameters) } end { $parameterQueue.ToArray() | Invoke-AtProtocol -Method $httpMethod -NamespaceID $NamespaceID -Parameter { $_ } -ParameterAlias $parameterAliases @InvokeAtSplat -ContentType $( if ($ContentType) { $ContentType } else { "application/json" } ) -AsByte:$AsByte -Property { $_ } -Cache:$( if ($cache) {$cache} else { $false } ) } } |