functions/event-pipeline/Get-TssEventPipelineStub.ps1
|
function Get-TssEventPipelineStub { <# .SYNOPSIS Get an empty event pipeline .DESCRIPTION Returns an event pipeline with default values, as the server starts a new one. .PARAMETER TssSession TssSession object created by New-TssSession for authentication .EXAMPLE $session = New-TssSession -SecretServer https://alpha -Credential $ssCred Get-TssEventPipelineStub -TssSession $session Returns a default event pipeline .LINK https://thycotic-ps.github.io/thycotic.secretserver/commands/event-pipelines/Get-TssEventPipelineStub .LINK https://github.com/thycotic-ps/thycotic.secretserver/blob/main/src/functions/event-pipeline/Get-TssEventPipelineStub.ps1 .NOTES Requires TssSession object returned by New-TssSession #> [CmdletBinding()] [OutputType('Thycotic.PowerShell.EventPipeline.Stub')] param ( [Parameter(Mandatory, ValueFromPipeline, Position = 0)] [Thycotic.PowerShell.Authentication.Session] $TssSession ) begin { $tssParams = $PSBoundParameters $invokeParams = . $GetInvokeApiParams $TssSession } process { Get-TssInvocation $PSCmdlet.MyInvocation if ($tssParams.ContainsKey('TssSession') -and $TssSession.IsValidSession()) { Compare-TssVersion $TssSession '10.9.000000' $PSCmdlet.MyInvocation $uri = $TssSession.ApiUrl, 'event-pipeline', 'stub' -join '/' $invokeParams.Uri = $uri $invokeParams.Method = 'GET' Write-Verbose "Performing the operation $($invokeParams.Method) $uri" try { $apiResponse = Invoke-TssApi @invokeParams $restResponse = . $ProcessResponse $apiResponse } catch { Write-Warning 'Issue with Get-TssEventPipelineStub request' $err = $_ . $ErrorHandling $err } if ($restResponse) { [Thycotic.PowerShell.EventPipeline.Stub](. $FilterTssResponse $restResponse ([Thycotic.PowerShell.EventPipeline.Stub])) } } else { Write-Warning 'No valid session found' } } } |