If I run
ng build -environment=localprod --base-href /Angular5Starter/ in command prompt I receive the following output:
However, if I run the same command from Powershell:
$ngBuildCommand = "ng build -environment=$($environment) --base-href /$($webSiteName)/" Write-Host "Ng build command: ", $ngBuildCommand cmd /c $ngBuildCommand
I receive a quite messed up output:
I have followed the suggestions from the comments and ran the command properly:
$ngExe = "C:\Program Files\nodejs\ng.cmd" & $ngExe build -environment="$environment" --base-href /$webSiteName/
However, the output text format is the same.
Question: Is it possible to catch cmd.exe output format (and maybe colors) in Powershell?