Functions/Get-OSServerVersion.ps1

function Get-OSServerVersion
{
    <#
    .SYNOPSIS
    DEPRECATED - Use Get-OSServerInfo
    Returns the OutSystems platform server version
 
    .DESCRIPTION
    This will returns the OutSystems platform server version.
 
    .EXAMPLE
    Get-OSServerVersion
 
    #>


    [CmdletBinding()]
    [OutputType('System.Version')]
    param ()

    begin
    {
        LogMessage -Function $($MyInvocation.Mycommand) -Phase 0 -Stream 0 -Message "Starting"
        SendFunctionStartEvent -InvocationInfo $MyInvocation
    }

    process
    {
        $output = GetServerVersion

        if (-not $output)
        {
            LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 3 -Message "Outsystems platform is not installed"
            WriteNonTerminalError -Message "Outsystems platform is not installed"

            return $null
        }

        LogMessage -Function $($MyInvocation.Mycommand) -Phase 1 -Stream 0 -Message "Returning $output"
        return [System.Version]$output
    }

    end
    {
        SendFunctionEndEvent -InvocationInfo $MyInvocation
        LogMessage -Function $($MyInvocation.Mycommand) -Phase 2 -Stream 0 -Message "Ending"
    }
}