PowerShell and JSON Configuration Files

If you run a lot of code in any environment, or have multiple environments that you manage, configuration files are incredibly useful. If you do not already use them, you should seriously consider it. JSON is my preferred format this task, and here is how I use it in PowerShell.

In the Windows world, it seems that these files are typically created in eXtensible Markup Language (XML). Xml will work, and if you are stuck with PowerShell version 2.0 or earlier, you may have to stick with that.

Read More

Build a VM from a Template

Creating VMs from a base image can make your life a lot easier. Not having to sit through and select the same options during an OS install is a big time save.
A lot of work can go into creating a base image, but it doesn’t have to. I will briefly touch on how to create a base Windows image and then get into the automation of creating a Hyper-V VM from that template.

Read More

Check if you are running as Administrator

I don’t know about you, but sometimes I try to run commands that need administrative rights without checking if I have those permissions in my current session. There have even been cases where I have built a function or script that needed a single command to run as an Administrator somewhere near the end, only to have the function get half way before saying ‘Access denied’.

Read More