Skip to content

Commit

Permalink
module - CheckVersion correct logic, remove function call
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmelton committed Mar 30, 2021
1 parent 9549907 commit a4799d8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/parts/CheckVersion.ps1
Expand Up @@ -21,9 +21,21 @@ param(

process {
$source = $Invocation.MyCommand
$currentVersion = (Get-TssVersion -TssSession $TssSession).Version
$uri = $TssSession.ApiUrl, 'version' -join '/'
$invokeParams.Uri = $Uri
$invokeParams.Method = 'GET'

if ($MinimumSupported -ge $currentVersion) {
try {
$restResponse = . $InvokeApi @invokeParams
} catch {
Write-Warning "Issue reading version, verify Hide Secret Server Version Numbers is disabled in Secret Server"
$err = $_
. $ErrorHandling $err
}

$currentVersion = $restResponse.model.version

if ($currentVersion -lt $MinimumSupported) {
Write-Warning "[$source] is only supported on [$MinimumSupported]+ of Secret Server. Secret Server host [$($TssSession.SecretServer)] version: [$currentVersion]"
}
}

0 comments on commit a4799d8

Please sign in to comment.