Put VSCode to Task
Today’s content isn’t exactly PowerShell-related. But I assume many of you use VS Code to create PowerShell content. If you’ve been using VS Code for any length of time, you know that it is a feature-rich tool with a learning curve. I think it is fair to say that it is a developer tool written by developers for developers. But that doesn’t mean PowerShell scripters should avoid it. Quite the contrary. There are many features in VS Code that will improve the quality of your code and reduce some of the friction. One of those features is the use of tasks.
Developers use tasks as part of their work process. They often build projects from their source code, which might require one or more build-related tasks. They may also have test tasks. As PowerShell scripters, we typically aren’t building anything. The script or module is the end product.
I know there are PowerShell scripters that use a defined process to build a module deliverable, which often includes deployment. These people can also take advantage of VSCode tasks, but I’m going to keep this article at the introduction level.
I want to show you how to get started with tasks in VSCode and understand how you can integrate them into your PowerShell work. The documentation on VSCode tasks tends to be developer-centric, with a lot of irrelevant content for our purposes. And, as you’ll see, there are a few potential stumbling blocks when incorporating PowerShell into a VSCode task.