DSCResources/ROACommon/Src/Get-ROAConsolePath.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function Get-ROAConsolePath {
<#
    .SYNOPSIS
        Returns the RES ONE Automation console path.
#>

    [CmdletBinding()]
    [OutputType([System.String])]
    param ( )
    begin {
        Assert-ROAComponent -Component 'Console';
    }
    process {

        $wmcRootPath = Get-ROAComponentInstallPath -Component 'Console';
        $wmcPath = Join-Path -Path $wmcRootPath -ChildPath 'wmc.exe';
        if (-not (Test-Path -Path $wmcPath -PathType Leaf)) {
            
            throw ($localizedData.ROAConsoleNotFoundError);
        }
        return $wmcPath;

    } #end process
} #end function Get-ROAConsolePath