DevOps PowerShell for Developers Tips and Tricks Tools

5 Tips for Writing DSC Resources in PowerShell 5

Matthew Hodgkins
1 min read
Share:

PowerShell 5 brought class based DSC Resources, which majorly simplifies the process of writing custom DSC resources.
During my time working on some custom resources, I developed some tips a long the way which should save you some time and pain during your DSC journey.
The tips cover:

  • Structuring your class based DSC Resources
  • Making it easier to get IntelliSense based on your DSC resources without constantly copying them into the module path
  • Using PowerShell ISE IntelliSense when writing DSC configuration
  • Troubleshooting resources which aren’t being exposed correctly from your DSC Module
  • Testing classed based resources with Pester

Head over to https://hodgkins.io/five-tips-for-writing-dsc-resources-in-powershell-version-5 to take a look at the tips.

Related Articles

Feb 2, 2016

Connect to all Office 365 Services with PowerShell

If you are not on Office 365 or have a tenant set up with Microsoft yet, now is the time to reserve your tenant name! With utilizing Office 365, a lot of administration is only available from a PowerShell session. There is a mix of outdated information on what you actually need to install and execute in order to connect to all of the Office 365 services. As a result, I accumulated and wrote up the current download requirements and commands to connect and administer every Office 365 service from one PowerShell session.

Jan 28, 2016

Using PowerShell to enable ChatOps on Windows

ChatOps is a term used to describe bringing development or operations work that is already happening in the background into a common chat room. It involves having everyone in the team in a single chat room, then bringing tools into the room so everyone can automate, collaborate and see how automation is used to solve problems. In doing so, you are unifying the communication about what work gets done and have a history of it happening.

Mar 28, 2019

Secure Your Powershell Session with JEA and Constrained Endpoints

Index What is a Constrained Endpoint and Why Would I Need One? Setup and Configuration Using our Endpoint What is a constrained endpoint and why would I need one? Powershell constrained endpoints are a means of interacting with powershell in a manner consistent with the principal of least privilege. In Powershell terms, this is referred to as Just-Enough-Administration, or JEA. JEA is very well documented, so this won’t simply be repeating everything those references detail.