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?
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. – RavennaUnrestricted
orBypass
). – Ravennadir * | 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? – TechnicC:\Program Files
and not withinC:\Program Files (x86)
? I have also realized that importing the module withimport-module xPSDesiredStateConfiguration
shows no exported commands (get-module
) however the module seems to load just fine... – Technicget-module -ListAvailable
isn't showing any of the xModules – Technic