functions/proxy/Get-TssProxyEndpointNotification.ps1

function Get-TssProxyEndpointNotification {
    <#
    .SYNOPSIS
    Get the proxy endpoint warning message
 
    .DESCRIPTION
    Returns the warning text Secret Server shows about the current proxy endpoint configuration, or an empty string when there is nothing to report.
 
    .PARAMETER TssSession
    TssSession object created by New-TssSession for authentication
 
    .EXAMPLE
    $session = New-TssSession -SecretServer https://alpha -Credential $ssCred
    Get-TssProxyEndpointNotification -TssSession $session
 
    Returns the proxy endpoint warning text
 
    .LINK
    https://thycotic-ps.github.io/thycotic.secretserver/commands/proxy/Get-TssProxyEndpointNotification
 
    .LINK
    https://github.com/thycotic-ps/thycotic.secretserver/blob/main/src/functions/proxy/Get-TssProxyEndpointNotification.ps1
 
    .NOTES
    Requires TssSession object returned by New-TssSession
    #>

    [CmdletBinding()]
    [OutputType('System.String')]
    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, 'proxy', 'endpoints', 'notification' -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-TssProxyEndpointNotification request'
                $err = $_
                . $ErrorHandling $err
            }
            if ($restResponse) {
                $restResponse | ConvertFrom-Json
            }
        } else {
            Write-Warning 'No valid session found'
        }
    }
}