PowerShell: How to install the DSC Resource Kit Wave 8 modules?
Asked Answered
A

3

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?

Arbela answered 31/10, 2014 at 14:7 Comment(7)
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.Ravenna
Oh one other thing, make sure your execution policy is set to allow script execution (try with Unrestricted or Bypass).Ravenna
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?Technic
It looks right to me; it matches my tree (though I'm still on Wave 6), and mine works.Ravenna
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...Technic
Same happens with wave 6...the strange is that get-module -ListAvailable isn't showing any of the xModulesTechnic
Let us continue this discussion in chat.Technic
A
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

Arbela answered 31/10, 2014 at 15:56 Comment(0)
P
3

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

Phosphatize answered 17/3, 2015 at 14:35 Comment(0)
A
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

Arbela answered 31/10, 2014 at 15:56 Comment(0)
D
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.

Deck answered 7/4, 2015 at 11:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.