DSC:模块文件* ModuleName *不包含具有所需版本1.0的模块

时间:2015-11-11 18:25:52

标签: powershell dsc powershell-v5.0

我正在尝试新的Desired状态配置并尝试使用新的类资源。我已在该过程中涉及的所有服务器上安装了WMF 5.0的预生产预览。

我有一个Http pull服务器设置,我将我的类资源部署到。

目标节点配置为从他们似乎正在执行的服务器获取资源。

但是,当我尝试将配置推送到使用此类资源的目标节点时,我收到以下错误

  

模块文件 ModuleName 未包含具有所需版本的模块   的 1.0。无法安装配置所需的模块依赖项。

有没有人在遇到此错误之前或知道这意味着什么?

SxSecurity.psm1文件中包含以下内容,为其提供所需的版本号:

@{

# Script module or binary module file associated with this manifest.
RootModule = 'SxSecurity.psm1'

# Version number of this module.
ModuleVersion = '1.0'

# ID used to uniquely identify this module
GUID = '00293be8-be0b-4902-9b49-12e32533a414'

# Author of this module
Author = 'Alexis.Coles'

# Company or vendor of this module
CompanyName = '****'

# Copyright statement for this module
Copyright = '(c) 2015 ****. All rights reserved.'

# Description of the functionality provided by this module
Description = 'Security dsc resources'

# Functions to export from this module
FunctionsToExport = @()

# Cmdlets to export from this module
CmdletsToExport = '*'

# Variables to export from this module
VariablesToExport = '*'

# Aliases to export from this module
AliasesToExport = '*'

# DSC resources to export from this module
DscResourcesToExport = @('SxPfxImport')

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{

    PSData = @{

    } # End of PSData hashtable

} 

}

1 个答案:

答案 0 :(得分:3)

好的,所以我已成为一个误导性错误信息的受害者,我想第二次,确定我之前偶然发现了这一点。

可能"找不到模块 ModuleName "我会更多地指出正确的方向。

事实证明,DSC决定将模块下载到" C:\ Program Files \ WindowsPowerShell \ Modules"不属于PSModulePath环境变量。

我添加了环境变量的路径,重新启动了服务器并恢复了操作!