functions/sdk-client-accounts/Get-TssSdkClientEnabled.ps1
|
function Get-TssSdkClientEnabled { <# .SYNOPSIS Get whether SDK client accounts are enabled .DESCRIPTION Get whether the SDK client accounts feature is enabled. Returns true or false. .PARAMETER TssSession TssSession object created by New-TssSession for authentication .EXAMPLE $session = New-TssSession -SecretServer https://alpha -Credential $ssCred Get-TssSdkClientEnabled -TssSession $session Returns true when SDK client accounts are enabled .LINK https://thycotic-ps.github.io/thycotic.secretserver/commands/sdk-client-accounts/Get-TssSdkClientEnabled .LINK https://github.com/thycotic-ps/thycotic.secretserver/blob/main/src/functions/sdk-client-accounts/Get-TssSdkClientEnabled.ps1 .NOTES Requires TssSession object returned by New-TssSession #> [CmdletBinding()] [OutputType('System.Boolean')] 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, 'sdk-client-accounts', 'enabled' -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-TssSdkClientEnabled request' $err = $_ . $ErrorHandling $err } if ($null -ne $restResponse) { [System.Convert]::ToBoolean($restResponse) } } else { Write-Warning 'No valid session found' } } } |