你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get-AzManagementGroupDeploymentWhatIfResult
获取管理组范围内部署的模板 What-If 结果。
语法
Get-AzManagementGroupDeploymentWhatIfResult
[-Name <String>]
-ManagementGroupId <String>
-Location <String>
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
-TemplateFile <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzManagementGroupDeploymentWhatIfResult
[-Name <String>]
-ManagementGroupId <String>
-Location <String>
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
-TemplateParameterObject <Hashtable>
-TemplateObject <Hashtable>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzManagementGroupDeploymentWhatIfResult
[-Name <String>]
-ManagementGroupId <String>
-Location <String>
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
-TemplateParameterObject <Hashtable>
-TemplateFile <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzManagementGroupDeploymentWhatIfResult
[-Name <String>]
-ManagementGroupId <String>
-Location <String>
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
-TemplateParameterObject <Hashtable>
-TemplateUri <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzManagementGroupDeploymentWhatIfResult
[-Name <String>]
-ManagementGroupId <String>
-Location <String>
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
-TemplateParameterObject <Hashtable>
-TemplateSpecId <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzManagementGroupDeploymentWhatIfResult
[-Name <String>]
-ManagementGroupId <String>
-Location <String>
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
-TemplateParameterFile <String>
-TemplateObject <Hashtable>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzManagementGroupDeploymentWhatIfResult
[-Name <String>]
-ManagementGroupId <String>
-Location <String>
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
-TemplateParameterFile <String>
-TemplateFile <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzManagementGroupDeploymentWhatIfResult
[-Name <String>]
-ManagementGroupId <String>
-Location <String>
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
-TemplateParameterFile <String>
-TemplateUri <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzManagementGroupDeploymentWhatIfResult
[-Name <String>]
-ManagementGroupId <String>
-Location <String>
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
-TemplateParameterFile <String>
-TemplateSpecId <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzManagementGroupDeploymentWhatIfResult
[-Name <String>]
-ManagementGroupId <String>
-Location <String>
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
-TemplateParameterFile <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzManagementGroupDeploymentWhatIfResult
[-Name <String>]
-ManagementGroupId <String>
-Location <String>
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
-TemplateParameterUri <String>
-TemplateObject <Hashtable>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzManagementGroupDeploymentWhatIfResult
[-Name <String>]
-ManagementGroupId <String>
-Location <String>
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
-TemplateParameterUri <String>
-TemplateFile <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzManagementGroupDeploymentWhatIfResult
[-Name <String>]
-ManagementGroupId <String>
-Location <String>
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
-TemplateParameterUri <String>
-TemplateUri <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzManagementGroupDeploymentWhatIfResult
[-Name <String>]
-ManagementGroupId <String>
-Location <String>
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
-TemplateParameterUri <String>
-TemplateSpecId <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzManagementGroupDeploymentWhatIfResult
[-Name <String>]
-ManagementGroupId <String>
-Location <String>
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
-TemplateObject <Hashtable>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzManagementGroupDeploymentWhatIfResult
[-Name <String>]
-ManagementGroupId <String>
-Location <String>
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
-TemplateUri <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzManagementGroupDeploymentWhatIfResult
[-Name <String>]
-ManagementGroupId <String>
-Location <String>
[-ResultFormat <WhatIfResultFormat>]
[-ExcludeChangeType <String[]>]
-TemplateSpecId <String>
[-SkipTemplateParameterPrompt]
[-Pre]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Get-AzManagementGroupDeploymentWhatIfResult cmdlet 获取指定管理组范围内模板部署的 ARM 模板 What-If 结果。 它返回一个更改列表,指示如果部署应用了哪些资源,而不对实际资源进行任何更改,则会更新哪些资源。 若要指定返回结果的格式,请使用 ResultFormat 参数。
示例
示例 1:在管理组范围内获取 What-If 结果
Get-AzManagementGroupDeploymentWhatIfResult `
-DeploymentName "deploy-01" `
-Location "West US" `
-ManagementGroupId "myManagementGroup" `
-TemplateFile "D:\Azure\Templates\ServiceTemplate.json" `
-TemplateParameterFile "D:\Azure\Templates\ServiceParameters.json" `
-ResultFormat "FullResourcePayloads"
此命令通过使用自定义模板文件和磁盘上的参数文件在管理组范围内获取 What-If 结果。 该命令使用 Location 参数指定存储部署数据的位置。 该命令使用 ManagementGroupId 参数指定将在其中部署模板的管理组。 该命令使用 TemplateFile 参数指定模板文件。 该命令使用 TemplateParameterFile 参数指定模板参数文件。 该命令使用 ResultFormat 参数设置 What-If 结果以包含完整的资源有效负载。
示例 2:使用 ResourceIdOnly 在管理组范围内获取 What-If 结果
Get-AzManagementGroupDeploymentWhatIfResult `
-DeploymentName "deploy-01" `
-Location "West US" `
-ManagementGroupId "myManagementGroup" `
-TemplateFile "D:\Azure\Templates\ServiceTemplate.json" `
-TemplateParameterFile "D:\Azure\Templates\ServiceParameters.json" `
-ResultFormat "ResourceIdOnly"
此命令通过使用自定义模板文件和磁盘上的参数文件在管理组范围内获取 What-If 结果。 该命令使用 Location 参数指定存储部署数据的位置。 该命令使用 ManagementGroupId 参数指定将在其中部署模板的管理组。 该命令使用 TemplateFile 参数指定模板文件。 该命令使用 TemplateParameterFile 参数指定模板参数文件。 该命令使用 ResultFormat 参数将 What-If 结果设置为仅包含资源 ID。
示例 3:使用 .bicepparam 文件计算 What-If
Get-AzManagementGroupDeploymentWhatIfResult -ManagementGroupId "myManagementGroup" -Location "West US" -TemplateParameterFile "./parameters.bicepparam"
此命令通过在磁盘上使用 .bicepparam 文件获取管理组范围内的 What-If 结果。 该命令使用 TemplateParameterFile 参数指定 .bicepparam 文件。
参数
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ExcludeChangeType
要从 What-If 结果中排除的资源更改类型的逗号分隔列表。
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Location
用于存储部署数据的位置。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ManagementGroupId
管理组 ID。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
要创建的部署的名称。 如果未指定,则提供模板文件时默认为模板文件名;默认为提供模板对象的当前时间,例如“20131223140835”。
Type: | String |
Aliases: | DeploymentName |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Pre
设置时,指示 cmdlet 应在自动确定要使用的版本时使用预发布 API 版本。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResultFormat
What-If 结果格式。
Type: | WhatIfResultFormat |
Accepted values: | ResourceIdOnly, FullResourcePayloads |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SkipTemplateParameterPrompt
如果提供的模板参数包含模板使用的所有必需参数,则跳过检查的 PowerShell 动态参数处理。 此检查会提示用户提供缺失参数的值,但提供 -SkipTemplateParameterPrompt 会立即忽略此提示,并在发现参数未在模板中绑定时立即出错。 对于非交互式脚本,可以提供 -SkipTemplateParameterPrompt,以便在未满足所有必需参数的情况下提供更好的错误消息。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TemplateFile
模板文件的本地路径。 支持的模板文件类型:json 和 bicep。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TemplateObject
表示模板的哈希表。
Type: | Hashtable |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TemplateParameterFile
要用于模板的参数文件。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TemplateParameterObject
表示参数的哈希表。
Type: | Hashtable |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TemplateParameterUri
模板参数文件的 URI。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TemplateSpecId
要部署的 templateSpec 的资源 ID。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TemplateUri
模板文件的 URI。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
输入
输出
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈