【发布时间】:2023-04-09 18:20:01
【问题描述】:
我正在尝试为使用资源管理器创建的 Azure VM 编写 DSC 配置。我想使用xRemoteFile,所以我尝试导入xPSDesiredStateConfiguration 模块,但是在部署时找不到。
我在网上搜索,得知我需要在部署之前安装 xPSDesiredStateConfiguration 模块。当我刚刚在 Azure 上创建 VM 时,我该怎么做?
配置文件开始:
Configuration Main
{
Param ( [string] $nodeName )
Import-DscResource -ModuleName PSDesiredStateConfiguration
Import-DscResource -Name MSFT_xRemoteFile -ModuleName xPSDesiredStateConfiguration
错误信息:
08:56:12 - [ERROR] + Import-DscResource -Name MSFT_xRemoteFile -ModuleName xPSDesiredState ...
08:56:12 - [ERROR] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
08:56:12 - [ERROR] The DSC engine could not load the module 'xPSDesiredStateConfiguration'. It
08:56:12 - [ERROR] was not found on the system.".
【问题讨论】:
-
这也适用于windows 2012r2。