Commands/Lexicons/com/atproto/identity/Update-AtProtoIdentityHandle.ps1
function Update-AtProtoIdentityHandle { <# .Synopsis com.atproto.identity.updateHandle .Description com.atproto.identity.updateHandle .Link https://github.com/bluesky-social/atproto/tree/main/lexicons/com/atproto/identity/updateHandle.json #> [Alias('Update-AtProtocolIdentityHandle','atproto.identity.updateHandle','com.atproto.identity.updateHandle')] [CmdletBinding(SupportsShouldProcess)] param( [Parameter(ValueFromPipelineByPropertyName)] [ComponentModel.DefaultBindingProperty('handle')] [String] $Handle ) begin { $NamespaceID = 'com.atproto.identity.updateHandle' $httpMethod = 'POST' $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 } ) } } |