Where to find Resources
WMF 4.0 ships with some basic DSC resources. As time goes on, it's likely that many Microsoft server products will include their own DSC resources for configuring those products. Also, Microsoft is releasing "out of band" waves of additional resources via the web.
You'll find some open-source community resources at http://github.com/powershellorg/dsc, and a Google or Bing search will likely turn up other folks' DSC projects.
A word on naming: the Microsoft "waves" of resources all have resource names that start with the letter "x," which stands for "experimental, unsupported, use at your own risk." Keep in mind that these are just PowerShell script modules, which means they're basically open-source. Microsoft has asked that any community derivatives or original work carry the letter "c" as a resource name prefix. The idea is that non-prefixed names (e.g., "WindowsFeature") is reserved for Microsoft. By not using non-prefixed names, you will avoid coming up with a resource that conflicts with later Microsoft releases. Within your own organization, adopt a resource name prefix that's unique to you, like "contosoBusinessApp" for a "BusinessApp" resource owned by Contoso.
|Keep in mind that you need resources on whatever computer you're using to author configurations, as well as on whatever nodes will implement those configurations.|
Microsoft provides the following resources in WMF 4:
- Script (runs custom scripts; kind of a catch-all when there isn't a resource to do what you want)
- Archive (zip and unzip files)
- Package (install MSI or Setup.exe)
- Group (local groups)
- User (local users)
- Log (logging mechanism for troubleshooting DSC)
DSC Resource Kit Wave 1 included the following:
- xComputer (renaming and domain join)
- xVHD (superceded by Wave 2 version)
- xVMHyperV (create VMs)
- xDNSServerAddress (binding DNS addresses to NICs, not managing DNS)
- xDSCWebService (deploys a pull server)
- xWebsite (superceded by Wave 2 version)
DSC Resource Kit Wave 2 included the following:
- xWaitForADDomain (pauses configuration until a domain is available)
- xSqlHAService (SQL high availability)
- xVhdFile (files copied to a VHD image)
There isn't really a single download for the DSC Resource Kit; as of this writing, each resource is a separate download from the TechNet Script Gallery.
|Please don't rely on this guide to be an ongoing, reliable directory of Microsoft-released DSC resources. You'll need to do some research to decide if there are later waves, bug fixes, or community versions of these resources. We won't be updating this portion of the guide constantly.|
Where to Put Resources
We'll discuss it more later in this guide, but in general you should save new resources in \Program Files\WindowsPowerShell\Modules. Each resource consists of a root module, and then has a DSCResources sub-folder for the actual working code. It's possible for a single root module to actually offer more than one named resource.
For example, suppose you have a DSC resource module named CorpApp. You would create the following folder:
The entire module would go into that folder. The root module file will be named something like CorpApp.psd1, and there will be a DSCResources sub-folder that contains additional script files for the actual resources. There's a whole section in this guide about deploying resources, so you'll find more detail there.
Note that you'll need to install resources on any computer where you plan to author configurations using PowerShell, and on any nodes that will use those resources in their configurations.