简体   繁体   English

PowerShell:如何安装DSC Resource Kit Wave 8模块?

[英]PowerShell: How to install the DSC Resource Kit Wave 8 modules?

I am trying to set up a DSC pull server on Windows 2012 R2 machine by following this technet article: 我正在尝试通过以下technet文章在Windows 2012 R2机器上设置DSC拉取服务器:

http://technet.microsoft.com/en-us/library/dn249913.aspx 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 要安装所有DSC Resource Kit模块,请解压缩下面的内容

 $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. 要确认安装,请运行Get-DSCResource以查看此页面上的所有资源都是列出的DSC资源。

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: 所以我将'DSC Resource Kit Wave 8 10282014'文件夹的内容复制到C:\\Program Files\\WindowsPowerShell\\Modules ,现在看起来如下:

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): 然后我重新启动我的PowerShell控制台,以确保它重新加载$env:PSModulePath ,其中包含此方法(为了更好的可读性,手动添加了linewrap):

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 eg xPSDesiredStateConfiguration . 但是get-module -ListAvailable只是没有监听上述任何模块,例如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). 此外, Get-DscResource cmdlet不返回此模块附带的任何资源(尤其是xDSCWebService是我正在寻找的用于设置拉取服务器的DSC资源)。

If I manually copy the content of xPSDesiredStateConfiguration\\DSCResources\\* to one of the modules path folder's I do see the DSC resources. 如果我手动将xPSDesiredStateConfiguration\\DSCResources\\*的内容复制到其中一个模块路径文件夹中,我看到DSC资源。 However the pull-server setup script ( Sample_xDscWebService.ps1 ) fails. 但是,pull-server安装脚本( Sample_xDscWebService.ps1 )失败。 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? 那么,我该如何安装DSC Resource Kit?

I had the same problem. 我有同样的问题。 After installation of 3 updates (KB2894029, KB2894179 and KB2883200) everything works ;) 安装3个更新(KB2894029,KB2894179和KB2883200)后一切正常;)

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. 以下博客文章的链接提到了KB2883200。 But installing it on my system did not make a change. 但是在我的系统上安装它并没有改变。

However it works on another fully patched Windows 2012 R2 server. 但它适用于另一个完全修补的Windows 2012 R2服务器。 Unfortunatley I don't have an easy access at work to patch my manually installed server to the latest available. Unfortunatley我无法轻松访问工作,将我手动安装的服务器修补到最新版本。

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

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 请参阅我的博客文章: http://tfl09.blogspot.com//2015/04/using-dsc-resource-kit-hot-fixes-may-be.html

That location points to the specific patches you need. 该位置指向您需要的特定补丁。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM