How to run a ps1 file in foreground? I noticed when I execute my ps1 file, instead of view the log of the ps1 file execution, a Background job is started. Is there anyway to run a ps1 file and get the same behavior we have when executing a sh or batch file?
Updates:
- My ps1 file:
$scratchOrgName=$args[0]
Write-Host "Hello " & $scratchOrgName
The
&
starts a new process. (It's called the background operator)Change the code into something like
or