Open glawrence opened 5 years ago
The difference happens because we run the script via powershell -File <script file name>
, while you likely run your script as a PowerShell command (i.e. just ./file.ps1
).
I'll reclassify this as a feature request: let's add a way to run a command instead of a script in a run configuration. This way, it'll be possible to run a script as powershell -c ./myscript.ps1
instead of powershell -file ./myscript.ps1
, and you'll get all the ordinary features of the command execution mode.
I have created a simple PowerShell script (with .ps1 extension, which GitHub did not like, hence it is .txt) as attached:
OutputDemo.txt
I am running PowerShell Core 6.1.2 on my Mac. If I type pwsh in the Terminal I can then type
./OutputDemo.ps1
and I see the following:If I open the file with IntelliJ IDEA 2018.3.3 and the "PowerShell v2.0.1" plugin and run the script from there, I see the following:
My key issue is that the error output is not being displayed in the same way as the interactive PowerShell console, the lines are all out of order and it is very confusing. Interestingly the error output is also different as the line, char information is not displayed.