Public/Start-P1Manager.ps1

function Start-P1Manager {
    <#
    .Synopsis
    Start PlannerOne manager for the given tenant.
 
    .Description
    Start PlannerOne manager for the given tenant.
 
    .Parameter Tenant
    The target tenant.
 
    .Example
    # Start PlannerOne manager for tenant named Prod.
    Start-P1Manager -Tenant Prod
    #>

    [cmdletbinding()]
    param( 
        [Parameter(Mandatory=$true)]
        [string] $Tenant
    )
    Process
    {
        if (!(Test-Tenant $Tenant)) {
            Write-Warning "Tenant $Tenant does not exist."
            Write-Warning "Operation canceled."
            return;
        }

        # get bin path for the tenant
        $servicePath = Get-ServicePath
        $managerPath = "$servicePath\$Tenant\PlannerOneManager.exe"
        
        Start-Process $managerPath
    }    
}