Tutorial by Examples

configuration EnableIISFeature { node localhost { WindowsFeature IIS { Ensure = “Present” Name = “Web-Server” } } } If you run this configuration in Powershell (EnableIISFeature), it will produce a localho...
Starting a DSC on a remote machine is almost just as simple. Assuming you've already set up Powershell remoting (or enabled WSMAN). $remoteComputer = "myserver.somedomain.com" $cred = (Get-Credential) Start-DSCConfiguration -ServerName $remoteComputer -Credential $cred -Verbose Nb: A...
Sometimes it can be useful to test your Powershell data files and iterate through the nodes and servers. Powershell 5 (WMF5) added this neat little feature for doing this called Import-PowerShellDataFile . Example: $data = Import-PowerShellDataFile -path .\MydataFile.psd1 $data.AllNodes
To list available DSC resources on your authoring node: Get-DscResource This will list all resources for all installed modules (that are in your PSModulePath) on your authoring node. To list all available DSC resources that can be found in the online sources (PSGallery ++) on WMF 5 : Find-DS...
Before you can use a resource in a configuration, you must explicitly import it. Just having it installed on your computer, will not let you use the resource implicitly. Import a resource by using Import-DscResource . Example showing how to import the PSDesiredStateConfiguration resource and the F...

Page 1 of 1