作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我创建了自定义 DSC 模块。我在 DSC 资源中只有两个值,其中一个是二维数组:
node ("localhost")
{
ChangeXML ChangeValue
{
NameFile=$PathToXml #Enter path to input xml
DownloadManagerCustomData =
@(
@{
Node = 'some path';
Value = 'some value'
}#end of hash array
@{
Node = 'some path';
Value = 'some value'
}#end of hash array
)#end of two dimensional array
}
}
[ClassVersion("1.0"), FriendlyName("ChangeXML")]
class ChangeXML : OMI_BaseResource
{
[Key] String NameFile;
[Write] *Array?* DownloadManagerCustomData;
};
最佳答案
[ClassVersion("1.0"), FriendlyName("ChangeXML")]
class ChangeXML : OMI_BaseResource
{
[Key] String NameFile;
[Write] EmbeddedInstance("MSFT_KeyValuePair")] String DownloadManagerCustomData[];
};
New-MofFile
PowerShell.org's DSC repo中的函数.它为您生成 MOF 并且运行良好(完全披露,我不隶属于它,但我为它贡献了一点代码)。
New-MofFile
(目前)不会处理这个问题,但可以这样做,当我有机会时,我可能会为此目的对其进行修补。
关于powershell - 如何在 powershell DSC 中正确写入参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26762169/
我是一名优秀的程序员,十分优秀!