The many layers of an onion
A few weeks ago, I started working on a project to create new PowerShell Desired State Configuration (DSC) that will integrate with the NetApp DataONTAP PowerShell toolkit. It has been a very exciting past month for me. I enjoy writing Powershell code and modules but for this project I started using two new components – PowerShell v5 classes and PowerShell DSC. Since I had never touched either of those, I read many articles and technical reports. I also dove head first into the project and learned a lot of new tricks along the way. Another thing that I decided to include was a full Unit testing solution using Pester. The testing became its own beast and definitely added a lot of complexity to the solution. In the end, I had a very solid solution that really began to organically grow on its own. I am super excited to share what I learned along the way so let’s jump into the deep end.
In this series, we will cover some very cutting-edge topics to which you may have never been exposed. When I started, I was definitely peeling the onion on much of this and as I go, I am learning more. I have a feeling that this will series will evolve as we go but my goals in the first few articles will be to discuss:
- PowerShell v5 Classes
- Definition and Structure
- Public vs Private methods – when does it make sense
- Declaring $this and what does this mean?
- Pester testing PowerShell classes
- PowerShell Desired State Configuration (DSC)
- Getting started and What do you need to do
- Build a simple DSC resource using PowerShell modules
- Pester testing a script based DSC resource
- Merging PowerShell Classes and DSC
- Defining the differences between a script based DSC and a class based DSC
- Build a simple DSC resource using PowerShell classes
- Pester testing PowerShell class based DSC resource
Check back in over the next few days as we start to peel back the onion and learn about how to maximize your PowerShell skills with PowerShell v5 classes and PowerShell DSC.