我正在尝试将各种自定义策略应用到 Azure 上的 Windows VM。大多数都没有问题,但是当尝试使用 SecurityPolicyDSC 模块(特别是 AccountPolicy 资源)时,我收到错误(通过 azure 上的来宾分配):
The file could not be read: Index operation failed; the array index evaluated to null.. The PowerShell DSC resource '[AccountPolicy]AccountPolicies' with SourceInfo 'C:\Users\tjohnson\Documents\DSC\AccountPolicyExample.ps1::8::9::AccountPolicy' threw one or more non-terminating errors while running the Test-TargetResource functionality
该策略目前仅在审核模式下应用。
为了排除故障,我使用 SecurityPolicy Github 上的 AccountPolicy 示例运行了它,希望它能正常工作。但是,我遇到了同样的错误。