Search code examples
angularpowershellbuild

Build multiple angular app with powershell


I am trying to create powershell script, which builds three different angular apps one after another.

It builds only first app and do nothing after. (never reach line with text "3"). No errors

What am I missing?

"1" ;
cd D:\GitNew\App\src\Applications\FT.SomeProject.Web ;

"2" ;
ng build --output-hashing=all --project=app --watch --deploy-url /dist/app/ --output-path wwwroot/dist/app/ ;

"3" ;
ng build --output-hashing=all --project=admin --watch --deploy-url /dist/admin/ --output-path wwwroot/dist/admin/ ;

"4" ;
ng build --output-hashing=all --project=teams --watch --deploy-url /dist/teams/ --output-path wwwroot/dist/teams/ ;

"done" ;
cmd /k ;

Solution

  • Solution - use new window (start powershell {command}):

    "1" ;
    cd D:\GitNew\App\src\Applications\FT.SomeProject.Web ;
    
    "2" ;
    start powershell {ng build --output-hashing=all --project=app --watch --deploy-url /dist/app/ --output-path wwwroot/dist/app/ ;}
    
    "3" ;
    start powershell {ng build --output-hashing=all --project=admin --watch --deploy-url /dist/admin/ --output-path wwwroot/dist/admin/ ;}
    
    "4" ;
    start powershell {ng build --output-hashing=all --project=teams --watch --deploy-url /dist/teams/ --output-path wwwroot/dist/teams/ ;}
    
    "done" ;
    cmd /k ;