Get-AzResourceGroupDeploymentWhatIfResult
获取资源组范围内部署的模板 What-If 结果。
语法
ByTemplateFileWithNoParameters (默认值)
Get-AzResourceGroupDeploymentWhatIfResult
-ResourceGroupName <String>
-TemplateFile <String>
[-Name <String>]
[-Mode <DeploymentMode>]
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
[-ValidationLevel <String>]
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByTemplateObjectAndParameterObject
Get-AzResourceGroupDeploymentWhatIfResult
-ResourceGroupName <String>
-TemplateParameterObject <Hashtable>
-TemplateObject <Hashtable>
[-Name <String>]
[-Mode <DeploymentMode>]
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
[-ValidationLevel <String>]
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByTemplateFileAndParameterObject
Get-AzResourceGroupDeploymentWhatIfResult
-ResourceGroupName <String>
-TemplateParameterObject <Hashtable>
-TemplateFile <String>
[-Name <String>]
[-Mode <DeploymentMode>]
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
[-ValidationLevel <String>]
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByTemplateUriAndParameterObject
Get-AzResourceGroupDeploymentWhatIfResult
-ResourceGroupName <String>
-TemplateParameterObject <Hashtable>
-TemplateUri <String>
[-Name <String>]
[-Mode <DeploymentMode>]
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
[-ValidationLevel <String>]
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByTemplateSpecResourceIdAndParamsObject
Get-AzResourceGroupDeploymentWhatIfResult
-ResourceGroupName <String>
-TemplateParameterObject <Hashtable>
-TemplateSpecId <String>
[-Name <String>]
[-Mode <DeploymentMode>]
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
[-ValidationLevel <String>]
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByTemplateObjectAndParameterFile
Get-AzResourceGroupDeploymentWhatIfResult
-ResourceGroupName <String>
-TemplateParameterFile <String>
-TemplateObject <Hashtable>
[-Name <String>]
[-Mode <DeploymentMode>]
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
[-ValidationLevel <String>]
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByTemplateFileAndParameterFile
Get-AzResourceGroupDeploymentWhatIfResult
-ResourceGroupName <String>
-TemplateParameterFile <String>
-TemplateFile <String>
[-Name <String>]
[-Mode <DeploymentMode>]
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
[-ValidationLevel <String>]
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByTemplateUriAndParameterFile
Get-AzResourceGroupDeploymentWhatIfResult
-ResourceGroupName <String>
-TemplateParameterFile <String>
-TemplateUri <String>
[-Name <String>]
[-Mode <DeploymentMode>]
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
[-ValidationLevel <String>]
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByTemplateSpecResourceIdAndParams
Get-AzResourceGroupDeploymentWhatIfResult
-ResourceGroupName <String>
-TemplateParameterFile <String>
-TemplateSpecId <String>
[-Name <String>]
[-Mode <DeploymentMode>]
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
[-ValidationLevel <String>]
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByParameterFileWithNoTemplate
Get-AzResourceGroupDeploymentWhatIfResult
-ResourceGroupName <String>
-TemplateParameterFile <String>
[-Name <String>]
[-Mode <DeploymentMode>]
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
[-ValidationLevel <String>]
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByTemplateObjectAndParameterUri
Get-AzResourceGroupDeploymentWhatIfResult
-ResourceGroupName <String>
-TemplateParameterUri <String>
-TemplateObject <Hashtable>
[-Name <String>]
[-Mode <DeploymentMode>]
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
[-ValidationLevel <String>]
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByTemplateFileAndParameterUri
Get-AzResourceGroupDeploymentWhatIfResult
-ResourceGroupName <String>
-TemplateParameterUri <String>
-TemplateFile <String>
[-Name <String>]
[-Mode <DeploymentMode>]
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
[-ValidationLevel <String>]
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByTemplateUriAndParameterUri
Get-AzResourceGroupDeploymentWhatIfResult
-ResourceGroupName <String>
-TemplateParameterUri <String>
-TemplateUri <String>
[-Name <String>]
[-Mode <DeploymentMode>]
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
[-ValidationLevel <String>]
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByTemplateSpecResourceIdAndParamsUri
Get-AzResourceGroupDeploymentWhatIfResult
-ResourceGroupName <String>
-TemplateParameterUri <String>
-TemplateSpecId <String>
[-Name <String>]
[-Mode <DeploymentMode>]
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
[-ValidationLevel <String>]
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByTemplateObjectWithNoParameters
Get-AzResourceGroupDeploymentWhatIfResult
-ResourceGroupName <String>
-TemplateObject <Hashtable>
[-Name <String>]
[-Mode <DeploymentMode>]
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
[-ValidationLevel <String>]
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByTemplateUriWithNoParameters
Get-AzResourceGroupDeploymentWhatIfResult
-ResourceGroupName <String>
-TemplateUri <String>
[-Name <String>]
[-Mode <DeploymentMode>]
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
[-ValidationLevel <String>]
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByTemplateSpecResourceId
Get-AzResourceGroupDeploymentWhatIfResult
-ResourceGroupName <String>
-TemplateSpecId <String>
[-Name <String>]
[-Mode <DeploymentMode>]
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
[-ValidationLevel <String>]
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Get-AzResourceGroupDeploymentWhatIfResult cmdlet 获取指定资源组范围内模板部署的 ARM 模板 What-If 结果。 它返回一个更改列表,指示如果部署应用了哪些资源,而不对实际资源进行任何更改,则会更新哪些资源。 若要指定返回结果的格式,请使用 ResultFormat 参数。
示例
示例 1:获取资源组范围内的 What-If 结果
Get-AzResourceGroupDeploymentWhatIfResult `
-DeploymentName "deploy-01" `
-ResourceGroupName "myRG1" `
-TemplateFile "D:\Azure\Templates\ServiceTemplate.json" `
-TemplateParameterFile "D:\Azure\Templates\ServiceParameters.json" `
-ResultFormat "FullResourcePayloads"
此命令通过使用自定义模板文件和磁盘上的参数文件在指定的资源组范围获取 What-If 结果。
该命令使用 ResourceGroupName 参数指定将在其中部署模板的资源组。
该命令使用 TemplateFile 参数指定模板文件。
该命令使用 TemplateParameterFile 参数指定模板参数文件。
该命令使用 ResultFormat 参数设置 What-If 结果以包含完整的资源有效负载。
示例 2:使用 ResourceIdOnly 在资源组范围内获取 What-If 结果
Get-AzResourceGroupDeploymentWhatIfResult `
-DeploymentName "deploy-01" `
-ResourceGroupName "myRG1" `
-TemplateFile "D:\Azure\Templates\ServiceTemplate.json" `
-TemplateParameterFile "D:\Azure\Templates\ServiceParameters.json" `
-ResultFormat "ResourceIdOnly"
此命令通过使用自定义模板文件和磁盘上的参数文件在指定的资源组范围获取 What-If 结果。
该命令使用 ResourceGroupName 参数指定将在其中部署模板的资源组。
该命令使用 TemplateFile 参数指定模板文件。
该命令使用 TemplateParameterFile 参数指定模板参数文件。
该命令使用 ResultFormat 参数将 What-If 结果设置为仅包含资源 ID。
示例 3:使用 .bicepparam 文件计算 What-If
Get-AzResourceGroupDeploymentWhatIfResult -ResourceGroupName "myRG1" -TemplateParameterFile "./parameters.bicepparam"
此命令通过在磁盘上使用 .bicepparam 文件获取资源组范围内的 What-If 结果。
该命令使用 TemplateParameterFile 参数指定 .bicepparam 文件。
参数
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
参数属性
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-ExcludeChangeType
要从 What-If 结果中排除的逗号分隔的资源更改类型。
参数属性
类型: | String[]
|
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-Mode
部署模式。
参数属性
类型: | DeploymentMode
|
默认值: | None |
接受的值: | Incremental, Complete |
支持通配符: | False |
不显示: | False |
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-Name
要创建的部署的名称。 如果未指定,则提供模板文件时默认为模板文件名;默认为提供模板对象的当前时间,例如“20131223140835”。
参数属性
类型: | String
|
默认值: | None |
支持通配符: | False |
不显示: | False |
别名: | 部署名称 |
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-Pre
设置时,指示 cmdlet 应在自动确定要使用的版本时使用预发布 API 版本。
参数属性
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-ResourceGroupName
资源组名称。
参数属性
类型: | String
|
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
(All)
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
What-If 结果格式。
类型: | WhatIfResultFormat
|
默认值: | None |
接受的值: | ResourceIdOnly, FullResourcePayloads |
支持通配符: | False |
不显示: | False |
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-SkipTemplateParameterPrompt
跳过 PowerShell 动态参数处理,用于检查提供的模板参数是否包含模板使用的所有必要参数。
此检查将提示用户提供缺失参数的值,但提供 -SkipTemplateParameterPrompt 会立即忽略此提示,如果发现参数未在模板中绑定,则会立即出错。
对于非交互式脚本,可以提供 -SkipTemplateParameterPrompt,以便在未满足所有必需参数的情况下提供更好的错误消息。
参数属性
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
-TemplateFile
模板文件的本地路径。 支持的模板文件类型:json 和 bicep。
参数属性
类型: | String
|
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
ByTemplateFileWithNoParameters
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateFileAndParameterObject
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateFileAndParameterFile
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateFileAndParameterUri
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-TemplateObject
表示模板的哈希表。
参数属性
参数集
ByTemplateObjectAndParameterObject
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateObjectAndParameterFile
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateObjectAndParameterUri
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateObjectWithNoParameters
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-TemplateParameterFile
要用于模板的参数文件。
参数属性
类型: | String
|
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
ByTemplateObjectAndParameterFile
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateFileAndParameterFile
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateUriAndParameterFile
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateSpecResourceIdAndParams
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByParameterFileWithNoTemplate
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-TemplateParameterObject
表示参数的哈希表。
参数属性
参数集
ByTemplateObjectAndParameterObject
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateFileAndParameterObject
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateUriAndParameterObject
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateSpecResourceIdAndParamsObject
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-TemplateParameterUri
模板参数文件的 URI。
参数属性
类型: | String
|
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
ByTemplateObjectAndParameterUri
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateFileAndParameterUri
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateUriAndParameterUri
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateSpecResourceIdAndParamsUri
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-TemplateSpecId
要部署的 templateSpec 的资源 ID。
参数属性
类型: | String
|
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
ByTemplateSpecResourceIdAndParamsObject
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateSpecResourceIdAndParams
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateSpecResourceIdAndParamsUri
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateSpecResourceId
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-TemplateUri
模板文件的 URI。
参数属性
类型: | String
|
默认值: | None |
支持通配符: | False |
不显示: | False |
参数集
ByTemplateUriAndParameterObject
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateUriAndParameterFile
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateUriAndParameterUri
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
ByTemplateUriWithNoParameters
Position: | Named |
必需: | True |
来自管道的值: | False |
来自管道的值(按属性名称): | True |
来自剩余参数的值: | False |
-ValidationLevel
设置 validate/what-if 的验证级别。 ValidationLevel 可以是 Template(跳过提供程序验证)、Provider(执行完全验证)或 ProviderNoRbac(使用 RBAC 读取检查而不是 RBAC 写入检查进行提供程序验证)执行完全验证。
参数属性
类型: | String
|
默认值: | None(Provider) |
支持通配符: | False |
不显示: | False |
参数集
(All)
Position: | Named |
必需: | False |
来自管道的值: | False |
来自管道的值(按属性名称): | False |
来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。
Microsoft.Azure.Management.ResourceManager.Models.DeploymentMode
输出