functions/devops-secrets-vault/Get-TssDsvTenantStub.ps1
|
function Get-TssDsvTenantStub { <# .SYNOPSIS Get an empty DevOps Secrets Vault tenant .DESCRIPTION Gets a DevOps Secrets Vault tenant object with default values, the template used to create a tenant. Requires a DevOps Secrets Vault license. .PARAMETER TssSession TssSession object created by New-TssSession for authentication .EXAMPLE $session = New-TssSession -SecretServer https://alpha -Credential $ssCred Get-TssDsvTenantStub -TssSession $session Get the default values of a new DSV tenant .LINK https://thycotic-ps.github.io/thycotic.secretserver/commands/devops-secrets-vault/Get-TssDsvTenantStub .LINK https://github.com/thycotic-ps/thycotic.secretserver/blob/main/src/functions/devops-secrets-vault/Get-TssDsvTenantStub.ps1 .NOTES Requires TssSession object returned by New-TssSession #> [CmdletBinding()] [OutputType('Thycotic.PowerShell.DevOpsSecretsVault.DsvTenant')] 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, 'devops-secrets-vault', 'tenant', '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-TssDsvTenantStub request' $err = $_ . $ErrorHandling $err } if ($restResponse) { [Thycotic.PowerShell.DevOpsSecretsVault.DsvTenant](. $FilterTssResponse $restResponse ([Thycotic.PowerShell.DevOpsSecretsVault.DsvTenant])) } } else { Write-Warning 'No valid session found' } } } |