gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 17:22:05 24 4
gpt4 key购买 nike

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

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

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

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

Module file ModuleName did not contain a module with required version 1.0. Could not install module dependencies needed by the configuration.

有没有人以前遇到过这个错误或者知道它是什么意思?

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

}

}

最佳答案

好吧,我已经成为一个相当具有误导性的错误信息的受害者,我想这是我第二次,当然我之前已经偶然发现了这个。

也许“Could not find Module ModuleName”会给我指明更多正确的方向。

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

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

关于powershell - DSC:模块文件 *ModuleName* 不包含具有所需版本 1.0 的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33657320/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com