azure - DSC 复合资源参数未显示在 Azure State DSC 上
问题描述
我正在为复合资源做一个示例,我已经创建了文件夹结构和清单,我可以导入它并在自动化帐户中看到它,但是由于某种原因,当我在 schema.psm1 中创建参数时,我看不到自动化帐户复合资源模块中可用的参数。我究竟做错了什么?
Configuration FeatureInstall {
Import-DscResource -ModuleName PSDscResources
param(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string[]]$EnsureFeature,
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string[]]$NameFeature,
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string[]]$IncludeAllSubFeatures
)
WindowsFeature Features
{
Ensure = $EnsureFeature
Name = $NameFeature
IncludeAllSubFeature = $IncludeAllSubFeatures
}
}
解决方案
我回答我自己的问题,我做错了,这对我有用。
Configuration FeatureInstall
{
param
(
[Parameter(Mandatory)]
[string]
$Feature,
[Parameter(Mandatory)]
[string]
$EnsureFeature,
[Parameter(Mandatory)]
[string]
$NameFeature,
[Parameter(Mandatory)]
[string]
$IncludeAllSubFeatures
)
WindowsFeatureSet $Feature
{
Ensure = $EnsureFeature
Name = $NameFeature
IncludeAllSubFeature = $IncludeAllSubFeatures
}
}
推荐阅读
- arrays - 当它是另一个数组的元素时,如何约束数组的元素类型
- arrays - AppSync,使用 graphql-tag 将数组作为输入参数传递
- c# - 当玩家在超过 1 个街区时碰撞抽搐
- objective-c - 连续调用 [NSPasteboard canReadObjectForClasses:options:] 导致内存膨胀
- .net - Azure 函数从 Cosmos Db Mongo 集合返回空数据集
- swift - TableView 单元格内更好的性能事件
- javascript - 我如何理解 reactjs 中的这个错误是什么?
- javascript - 如何按行搜索并替换该行的内容
- dropdown - laravel 背包 select2 占位符
- javascript - 使用 Javascript 自动预选下拉菜单