How to configure a VSCode Task to run a powershell script in the integrated terminal

Question:

In such a way that it is not in a sub shell. I need it to be able to prepare the environment…set environment variable.

Answer:

I am sorry, but you are not correctly editing the .vscode/tasks.json file.

In your scenario, lets say you have some powershell script ./scripts/mycustomPSscript.ps1 you want to run as a vscode task. For such goal, edit the tasks file so it follows the below example:

Source:

How to configure a VSCode Task to run a powershell script in the integrated terminal by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply