Functions/Start-JTGateway.ps1


function Start-JTGateway {
    $GatewayVM = "JT-Gateway2"
    if(((Get-VM $GatewayVM).State) -ne "Running") {
        Start-VM $GatewayVM -AsJob
        while (!(Get-VMNetworkAdapter $GatewayVM | Where-Object IPAddresses)) { Start-Sleep 2 }
    }



}

New-Alias sgw Start-JTGateway -PassThru -Force -ErrorAction 0
Export-ModuleMember -Alias sgw