Public/Get-PBRubrikReport.ps1
function Get-PBRubrikReport { [PoshBot.BotCommand( CommandName = 'rubrik_report', Aliases = 'report' )] [cmdletbinding()] param( [PoshBot.FromConfig()] [parameter(Mandatory)] [hashtable]$Connection, [string]$Name, [ValidateSet('Canned', 'Custom')] [string]$Type, [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-RubrikReport @params $ResponseSplat = @{ Text = Format-PBRubrikObject -Object $objects -FunctionName $MyInvocation.MyCommand.Name AsCode = $true } New-PoshBotTextResponse @ResponseSplat } |