【发布时间】:2021-01-11 02:45:37
【问题描述】:
我需要通过 azure DSC 将文件从 azure 存储帐户复制到 vm。
以下是我尝试过的
配置示例DSC { 安装模块-名称'xPSDesiredStateConfiguration'-force 导入-DscResource -Name 'xPSDesiredStateConfiguration'
Node localhost
{
File CreateFolder
{
Type = 'Directory'
DestinationPath = 'C:\NewFolder'
Ensure = "Present"
}
xRemoteFile remotefile {
# for uri generate a sas token then copy the sas token url in the uri line below
Uri = "storageblob+SAS token"
DestinationPath = "C:\NewFolder\"
DependsOn = "[File]CreateFolder"
MatchSource = $false
}
}
但我遇到错误 - 请帮助
错误消息:“DSC 扩展收到错误的输入:发生错误时 执行脚本或模块'importcertificate.ps1':在 C:\Packages\Plugins\Microsoft.Powershell.DSC\2.80.1.0\DSCWork\importcertificate.1\importcertificate.ps1:4 char:6
-
Import-DscResource -Name 'xPSDesiredStateConfiguration'
无法加载资源“xPSDesiredStateConfiguration”:找不到资源。 请更正输入并重试执行扩展。”
我应该只使用:安装 PSDesiredStateConfiguration 吗?
【问题讨论】:
标签: powershell azure-resource-manager dsc