Public/Get-SIADatabaseStrongAccount.ps1
|
# .ExternalHelp IdentityCommand.SIA-help.xml function Get-SIADatabaseStrongAccount { [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', '', Justification = 'False Positive')] [CmdletBinding(DefaultParameterSetName = 'List')] param( [parameter( Mandatory = $true, ValueFromPipelinebyPropertyName = $true, ParameterSetName = 'ById' )] [Alias('id')] [String]$strong_account_id, [parameter( Mandatory = $false, ValueFromPipelinebyPropertyName = $true, ParameterSetName = 'List' )] [ValidateRange(1, 1000)] [int]$limit, [parameter( Mandatory = $false, ValueFromPipelinebyPropertyName = $true, ParameterSetName = 'List' )] [String]$cursor ) BEGIN { }#begin PROCESS { switch ($PSCmdlet.ParameterSetName) { 'ById' { $URI = "$($ISPSSSession.tenant_url)/api/database-strong-accounts/$strong_account_id" } 'List' { $URI = "$($ISPSSSession.tenant_url)/api/database-strong-accounts" $QueryString = $($PSBoundParameters | Get-Parameter | ConvertTo-QueryString) If ($null -ne $QueryString) { $URI = "$URI`?$QueryString" } } } #Send Request $result = Invoke-IDRestMethod -Uri $URI -Method GET if ($null -ne $result) { switch ($PSCmdlet.ParameterSetName) { 'List' { if ($null -ne $result.nextCursor) { ##TODO Result Pagination } $result.items } 'ById' { $result } } } }#process END { }#end } |