【问题标题】:DSC: Module file *ModuleName* did not contain a module with required version 1.0DSC:模块文件 *ModuleName* 不包含所需版本 1.0 的模块
【发布时间】:2015-11-11 18:25:52
【问题描述】:

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

我有一个 Http 拉取服务器设置,我已将我的课程资源部署到其中。

目标节点被配置为从他们似乎正在做的这个服务器获取资源。

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

模块文件 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

} 

}

【问题讨论】:

    标签: powershell dsc powershell-5.0


    【解决方案1】:

    好吧,所以我已经成为一个相当误导性错误消息的受害者,我认为这是第二次,肯定我以前偶然发现过这个。

    也许“找不到模块 ModuleName”会为我指明正确的方向。

    事实证明,DSC 决定将模块下载到“C:\Program Files\WindowsPowerShell\Modules”的位置不是 PSModulePath 环境变量的一部分。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-09
      相关资源
      最近更新 更多