Public/Get-PBRubrikSLA.ps1
function Get-PBRubrikSLA { [PoshBot.BotCommand( CommandName = 'rubrik_sla', Aliases = 'sla' )] [cmdletbinding()] param( [PoshBot.FromConfig()] [parameter(Mandatory)] [hashtable]$Connection, [string]$Name, [string]$PrimaryClusterId, [string]$Id ) $creds = [pscredential]::new($Connection.Username, ($Connection.Password | ConvertTo-SecureString -AsPlainText -Force)) $null = Connect-Rubrik -Server $Connection.Server -Credential $creds $params = $PSBoundParameters $params.Remove('Connection') | Out-Null $objects = Get-RubrikSLA @params | Select-Object -Property name,id,frequencies $ResponseSplat = @{ Text = Format-PBRubrikObject -Object $objects -FunctionName $MyInvocation.MyCommand.Name AsCode = $true } New-PoshBotTextResponse @ResponseSplat } |