Azure SecurityPolicyDSc 错误 -“数组索引计算结果为 null”

问题描述 投票:0回答:1

我正在尝试将各种自定义策略应用到 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 示例运行了它,希望它能正常工作。但是,我遇到了同样的错误。

azure powershell devops dsc azure-policy
1个回答
0
投票

您正在应用策略的 VM 上的 SecurityPolicyDsc 模块文件可能已损坏。请尝试这个:

© www.soinside.com 2019 - 2024. All rights reserved.