Skip to content
Menu
The Lonely Administrator
  • PowerShell Tips & Tricks
  • Books & Training
  • Essential PowerShell Learning Resources
  • Privacy Policy
  • About Me
The Lonely Administrator

DSC Resource Snippets

Posted on May 23, 2014

talkbubbleA few days ago I posted a PowerShell script that would generate a DSC configuration template. The idea was to generate all the code you might need and let you whittle it down to just what you need. On my primary system, I don't have any community or experimental DSC resources so my configuration template script only gets the default resources. Towards the end of the article I mentioned that another option would be to create snippets you could use in the PowerShell ISE. So I did.

Manage and Report Active Directory, Exchange and Microsoft 365 with
ManageEngine ADManager Plus - Download Free Trial

Exclusive offer on ADManager Plus for US and UK regions. Claim now!

In PowerShell 4 Microsoft already includes a simple  DSC configuration snippet. In the ISE,  hit Ctrl+J and start typing DSC and you should see a snippet title DSC Configuration (simple).  I ran my configuration template script and then converted each resource into its own snippet just for you.

Download DSC-Resource-Snippets.zip and extract the .ps1xml files to your Snippets directory, C:\Users\\Documents\WindowsPowerShell\Snippets. That folder may not exist if you have not created of your own snippets. When you start the ISE and press Ctrl+J and start typing DSC you should see a snippet for each resource.

dsc-snippets

Find the one you want and press Enter. Use these snippets in conjunction with the DSC configuration snippet and you are practically finished with just a few key strokes. Edit and enjoy.


Behind the PowerShell Pipeline

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to print (Opens in new window) Print
  • Click to email a link to a friend (Opens in new window) Email

Like this:

Like Loading...

Related

reports

Powered by Buttondown.

Join me on Mastodon

The PowerShell Practice Primer
Learn PowerShell in a Month of Lunches Fourth edition


Get More PowerShell Books

Other Online Content

github



PluralSightAuthor

Active Directory ADSI Automation Backup Books CIM CLI conferences console Friday Fun FridayFun Function functions Get-WMIObject GitHub hashtable HTML Hyper-V Iron Scripter ISE Measure-Object module modules MrRoboto new-object objects Out-Gridview Pipeline PowerShell PowerShell ISE Profile prompt Registry Regular Expressions remoting SAPIEN ScriptBlock Scripting Techmentor Training VBScript WMI WPF Write-Host xml

©2025 The Lonely Administrator | Powered by SuperbThemes!
%d