验证成功时,Test-AzureRmResourceGroupDeployment cmdlet返回Empty

juv*_*han 3 powershell azure azure-powershell azure-resource-manager azure-rm-template

我使用下面的Azure Powershell cmdlet来验证ARM模板json和ARM模板params json文件.

$result = Test-AzureRmResourceGroupDeployment -ResourceGroupName TestRG -TemplateFile TestARMTemplate.json -ApiVersion TestARMParams.json
Run Code Online (Sandbox Code Playgroud)

如果两个输入参数都有效,我希望cmdlet返回true(布尔类型).

但是,结果是空的.

该文档还不清楚此cmdlet的预期响应.

我想知道我得到的回应是否是预期的回应.

注意:我在Windows 10计算机上使用Azure PowerShell 1.5版(20166月).

Gau*_*tri 5

查看此Cmdlet的源代码here,我认为它不会返回true或false.它实际上返回一个类型的对象List<PSResourceManagerError>.如果你对$result对象进行计数,如果一切正常,它应该返回零.