Power shell

Add a PowerShell DSC resource to a pull server

Add a PowerShell DSC resource to a pull server

If you haven’t start learning PowerShell Desired State Configuration yet, you should its awesome. One of the things that kept catching me out, was adding new DSC resources to my pull server. The resources are PowerShell modules, so you just download them from the PowerShell Gallery right? No. The steps I follow are below, they should be performed on the Pull server directly or via a PS session

  • Install the module from the PowerShell Gallery - In this case the community Docker resource (Which is very cool)
Install-Module -Name cDscDocker
  • Import the resource into the server (Change -ListAvailable to -ModuleVersion if you want anything specific)
Get-Module cDscDocker -ListAvailable | Publish-ModuleToPullServer -PullServerWebConfig "$env:SystemDrive\inetpub\wwwroot\PSDSCPullServer\web.config"
  • Check the resource is installed, it should be listed by the following command
Get-DSCResource

and that’s it.