32 lines
1.1 KiB
PowerShell
32 lines
1.1 KiB
PowerShell
|
function Test-ShouldInstallExceptionService {
|
||
|
<#
|
||
|
.SYNOPSIS
|
||
|
Check to see if we should install the ExceptionService based on the file version of ORB installed
|
||
|
#>
|
||
|
[CmdletBinding()]
|
||
|
[OutputType([System.Boolean])]
|
||
|
param(
|
||
|
)
|
||
|
|
||
|
$logLead = (Get-LogLeadName)
|
||
|
|
||
|
# ex: 2020.2.0.53
|
||
|
$version = [System.Version](Get-OrbVersion)
|
||
|
$eolVersion = [System.Version]'2020.5' #2020.5.0.0 > 2020.5
|
||
|
|
||
|
if ($null -eq $version) {
|
||
|
throw "$logLead : ORB Version not found, can not continue. Ensure ORB was deployed to the server before this was called."
|
||
|
}
|
||
|
|
||
|
# ([System.Version]'2020.5.0.1').CompareTo([system.Version]'2020.5.0.0') => 1
|
||
|
# https://docs.microsoft.com/en-us/dotnet/api/system.version.compareto
|
||
|
# Return value Meaning
|
||
|
# Less than zero The current Version object is a version before value.
|
||
|
# Zero The current Version object is the same version as value.
|
||
|
# Greater than zero The current Version object is a version subsequent to value, or value is null.
|
||
|
if ($version.CompareTo($eolVersion) -ge 0) {
|
||
|
return $false
|
||
|
}
|
||
|
|
||
|
return $true
|
||
|
}
|