VSCode script template with logging

I recently created an alternative version of the script template. This one is for PowerShell scripts and includes additions for the logging that I do both within a log file and Event Viewer. I am including the template and the code to add to VSCode to make it a snippet. I also have the code and snippets for adding the logging within the script. Continue reading “VSCode script template with logging”

Using VSCode snippets to apply your script template

Previously I wrote about the need for standardizing scripts and showed the template that I made. The question is how to easily start your scripts from the template.  You can open the template and save it as a new file but I think that is extra work I do not want to do.  If your script editor allows for the use of code snippets, things become easier.  My editor of choice is Visual Studio Code (VSCode) and I will show you how to create a code snippet for your template.  You can use this to easily add repeatable code to your scripts.  Again, this is being done with VSCode which is what I recommend as I love the script analyzer that it has as well as the ability to expand its functionality with community created extensions. Continue reading “Using VSCode snippets to apply your script template”