Automation Engineering on the Microsoft Stack
  • Introduction
  • What?
  • Delivery
    • Team
      • Dev Automation Lead
    • Environment
    • Workflow
    • Pipeline
    • Architecture
    • Tools
      • Task Manager
      • Continuous Delivery Server
    • Managing
      • Metrics
  • Development
    • Tools
      • Polly
      • Brighter
      • Topshelf
  • Source Control
    • Tools
      • SVN
      • Git
    • Managing
      • Metrics
  • Build
    • Stages
    • Tools
      • MSBuild
      • Roslyn
    • Managing
      • Metrics
  • Deployment
    • Stages
    • Tools
      • OctopusDeploy
    • Managing
      • Metrics
  • Quality
    • Team Quality
    • Stages
    • Scripting
    • Tools
      • NUnit
      • Web Driver
      • TestPipe
      • TestShot
      • Tarsvin
      • Montebank
      • Postman
    • Managing
      • Metrics
    • Stages
    • Coverage
  • Continuous Delivery Meetup
  • Infrastructure
    • Virtualization
    • PowerShell
    • DSC
      • Get Started
      • Configuration
      • Managed Object Format
      • Resources
      • Make It So
      • Automation
      • Testing
      • Security
      • Debug and Troubleshoot
      • Managing
      • Learn More
    • Managing
      • Metrics
  • Monitoring
  • Management
Powered by GitBook
On this page
  • Install Resources
  • Update PSModulePath
  • Custom Resources
  • Deploy Resources

Was this helpful?

  1. Infrastructure
  2. DSC

Resources

Resources are the real work horses in DSC. A resource is really a PowerShell module that provides some functionality to your DSC configurations.

Install Resources

To install resources you basically have to make it available in a directory that is known to PowerShell, in other words, defined in the PSModulePath environment variable.

Update PSModulePath

You can add your custom resource directory to the PSModulePath by invoking the script below or manual editing the variable.

$currentModulePath = [Environment]::GetEnvironmentVariable("PSModulePath", "Machine")
$customModulePath = "C:\_DSC\DSCResources"
$newModulePath = $currentModulePath + ";" + $customModulePath
[Environment]::SetEnvironmentVariable("PSModulePath", $newModulePath, "Machine")

I complicated this script a bit so it is more self evident on what is happening (code as documentation).

Custom Resources

You can create a custom resource to provide functionality not already available in other resources. For example I create an pneInitialize resource to provide common server configuration for all of the nodes in an environment. I prefix with pne which is a custom prefix for the environment I created this resouce for. You will see common prefixes like x, for experimental an c, for community.

A DSC Resource contains

  • Module (psm1)

  • Data (psd1) optional

  • Schema (schema.mof)

Deploy Resources

PreviousManaged Object FormatNextMake It So

Last updated 5 years ago

Was this helpful?

http://blogs.msdn.com/b/powershell/archive/2013/11/15/hungry-for-more-windows-powershell-desired-state-configuration-resources.aspx
http://blogs.msdn.com/b/powershell/archive/2013/11/19/resource-designer-tool-a-walkthrough-writing-a-dsc-resource.aspx
http://blogs.msdn.com/b/powershell/archive/2014/05/29/wish-i-can-author-dsc-resource-in-c.aspx
http://blogs.msdn.com/b/powershell/archive/2013/12/05/how-to-deploy-and-discover-windows-powershell-desired-state-configuration-resources.aspx