3

I am trying to set up a DSC pull server on Windows 2012 R2 machine by following this technet article:

http://technet.microsoft.com/en-us/library/dn249913.aspx

However I just can't get the modules working. The installation instructions says:

To install all DSC Resource Kit Modules, unzip the content under

$env:ProgramFiles\WindowsPowerShell\Modules 

To confirm installation run Get-DSCResource to see that all of the resources on this page are among the DSC Resources listed.

So I copied the content of the 'DSC Resource Kit Wave 8 10282014' folder to C:\Program Files\WindowsPowerShell\Modules which now looks as follows:

c:\Program Files\WindowsPowerShell\Modules>tree
├───cFileShare
│   ├───DSCResources
│   │   ├───VSAR_cCreateFileShare
│   │   └───VSAR_cSetSharePermissions
│   ├───Examples
│   ├───ResourceDesignerScripts
│   └───Unit Tests
├───xActiveDirectory
│   ├───DSCResources
│   │   ├───MSFT_xADDomain
│   │   ├───MSFT_xADDomainController
│   │   ├───MSFT_xADDomainTrust
│   │   ├───MSFT_xADUser
│   │   └───MSFT_xWaitForADDomain
│   └───Misc
├───xAdcsDeployment
│   ├───DSCResources
│   │   ├───MSFT_xAdcsCertificationAuthority
│   │   └───MSFT_xAdcsWebEnrollment
│   └───xCertificateServices
│       ├───DSCResources
│       │   ├───MSFT_xAdcsCertificationAuthority
│       │   └───MSFT_xAdcsWebEnrollment
│       └───Examples
[...]

Then I restarted my PowerShell console to ensure it's reloading $env:PSModulePath which contains this by the way (added linewrap manually for better readability):

PS C:\Users\Administrator> $env:PSModulePath
C:\Users\Administrator\Documents\WindowsPowerShell\Modules;
C:\Program Files\WindowsPowerShell\Modules;
C:\Windows\system32\WindowsPowerShell\v1.0\Modules\

So everything is pretty much default here. However get-module -ListAvailable is just not listening any of the above modules e.g. xPSDesiredStateConfiguration. Also the Get-DscResource cmdlet is not returning any ressources that come with this module (especially xDSCWebService is the DSC resource I am looking for to setup the pull server).

If I manually copy the content of xPSDesiredStateConfiguration\DSCResources\* to one of the modules path folder's I do see the DSC resources. However the pull-server setup script (Sample_xDscWebService.ps1) fails. Opening the editor it shows me a syntax error near to:

Import-DSCResource -ModuleName xPSDesiredStateConfiguration

I just can't figure out what I am doing wrong here. So, how can I install the DSC Resource Kit?

Matthias Güntert
  • 4,013
  • 6
  • 41
  • 89
  • Did you unblock the file after downloading? If not, the unzipped files may also have the "mark of the web". You can use `Unblock-File` from within Powershell or just right click, properties, unblock. If this is the case, it's probably easier to delete the directory tree, unblock the zip, and re-unzip. – briantist Oct 31 '14 at 14:11
  • Oh one other thing, make sure your execution policy is set to allow script execution (try with `Unrestricted` or `Bypass`). – briantist Oct 31 '14 at 14:13
  • I have just tried `dir * | unblock-file` from within the modules folder with no luck. also setting the execution policy to unrestricted didn't change a thing. Is the way i created the module folder structure okay? – Matthias Güntert Oct 31 '14 at 14:24
  • It looks right to me; it matches my tree (though I'm still on Wave 6), and mine works. – briantist Oct 31 '14 at 14:31
  • So yours are also within `C:\Program Files` and not within `C:\Program Files (x86)`? I have also realized that importing the module with `import-module xPSDesiredStateConfiguration` shows no exported commands (`get-module`) however the module seems to load just fine... – Matthias Güntert Oct 31 '14 at 15:17
  • Same happens with wave 6...the strange is that `get-module -ListAvailable` isn't showing any of the xModules – Matthias Güntert Oct 31 '14 at 15:24
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/64037/discussion-between-matze-and-briantist). – Matthias Güntert Oct 31 '14 at 15:25

3 Answers3

3

I had the same problem. After installation of 3 updates (KB2894029, KB2894179 and KB2883200) everything works ;)

koozka
  • 31
  • 2
0

This issue seems to be related to some missing patches. Unfortunately I dont know which one. The link to the blog post below is mentioning KB2883200. But installing it on my system did not make a change.

However it works on another fully patched Windows 2012 R2 server. Unfortunatley I don't have an easy access at work to patch my manually installed server to the latest available.

http://blogs.msdn.com/b/powershell/archive/2013/12/26/holiday-gift-desired-state-configuration-dsc-resource-kit-wave-1.aspx

Matthias Güntert
  • 4,013
  • 6
  • 41
  • 89
0

I had this error and fixed it!
See my blog post at http://tfl09.blogspot.com//2015/04/using-dsc-resource-kit-hot-fixes-may-be.html

That location points to the specific patches you need.

Thomas Lee
  • 1,158
  • 6
  • 13