Commands/Lexicons/com/atproto/server/Add-AtProtoServerAccount.ps1
function Add-AtProtoServerAccount { <# .Synopsis com.atproto.server.createAccount .Description com.atproto.server.createAccount .Link https://github.com/bluesky-social/atproto/tree/main/lexicons/com/atproto/server/createAccount.json #> [Alias('Add-AtProtocolServerAccount','atproto.server.createAccount','com.atproto.server.createAccount')] [CmdletBinding(SupportsShouldProcess)] param( [Parameter(ValueFromPipelineByPropertyName)] [ComponentModel.DefaultBindingProperty('email')] [String] $Email, [Parameter(ValueFromPipelineByPropertyName)] [ComponentModel.DefaultBindingProperty('handle')] [String] $Handle, # The Decentralized Identifier. This is a uniqueID used throughout the At Protocol. [Parameter(ValueFromPipelineByPropertyName)] [ComponentModel.DefaultBindingProperty('did')] [String] $Did, [Parameter(ValueFromPipelineByPropertyName)] [ComponentModel.DefaultBindingProperty('inviteCode')] [String] $InviteCode, [Parameter(ValueFromPipelineByPropertyName)] [ComponentModel.DefaultBindingProperty('password')] [String] $Password, [Parameter(ValueFromPipelineByPropertyName)] [ComponentModel.DefaultBindingProperty('recoveryKey')] [String] $RecoveryKey ) begin { $NamespaceID = 'com.atproto.server.createAccount' $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 } ) } } |