From 5e3f943b06b732092d4f679c10ae71b0b4f00a81 Mon Sep 17 00:00:00 2001 From: cormacpayne Date: Tue, 2 Apr 2019 17:38:17 -0700 Subject: [PATCH] Resolve review feedback --- .../ResourceWithParameterCmdletBase.cs | 9 ++- .../Resources.Test/ScenarioTests/Common.ps1 | 6 +- .../ScenarioTests/DeploymentTests.ps1 | 2 +- .../Resources/help/New-AzDeployment.md | 72 ++++++++++--------- .../help/New-AzResourceGroupDeployment.md | 54 +++++++------- .../Resources/help/Test-AzDeployment.md | 48 ++++++------- .../help/Test-AzResourceGroupDeployment.md | 56 +++++++-------- .../Az.Resources/SignatureIssues.csv | 6 +- 8 files changed, 128 insertions(+), 125 deletions(-) diff --git a/src/Resources/ResourceManager/Implementation/CmdletBase/ResourceWithParameterCmdletBase.cs b/src/Resources/ResourceManager/Implementation/CmdletBase/ResourceWithParameterCmdletBase.cs index 825809a7f2a6..6a547b00bf3b 100644 --- a/src/Resources/ResourceManager/Implementation/CmdletBase/ResourceWithParameterCmdletBase.cs +++ b/src/Resources/ResourceManager/Implementation/CmdletBase/ResourceWithParameterCmdletBase.cs @@ -116,12 +116,15 @@ protected ResourceWithParameterCmdletBase() [ValidateNotNullOrEmpty] public string TemplateUri { get; set; } - [Parameter(Mandatory = false, HelpMessage = "Skip resolving dynamic parameters; this should be used when running a script or running this command as a job.")] - public SwitchParameter IgnoreDynamicParameters { get; set; } + [Parameter(Mandatory = false, HelpMessage = "Skips the PowerShell dynamic parameter processing that checks if the provided template parameter contains all necessary parameters used by the template. " + + "This check would prompt the user to provide a value for the missing parameters, but providing the -SkipTemplateParameterPrompt will ignore this prompt and " + + "error out immediately if a parameter was found not to be bound in the template. For non-interactive scripts, -SkipTemplateParameterPrompt can be provided " + + "to avoid generic error messages from being thrown.")] + public SwitchParameter SkipTemplateParameterPrompt { get; set; } public object GetDynamicParameters() { - if (!this.IsParameterBound(c => c.IgnoreDynamicParameters)) + if (!this.IsParameterBound(c => c.SkipTemplateParameterPrompt)) { if (TemplateObject != null && TemplateObject != templateObject) diff --git a/src/Resources/Resources.Test/ScenarioTests/Common.ps1 b/src/Resources/Resources.Test/ScenarioTests/Common.ps1 index 8e91f1d9d7c9..01323ee6ff04 100644 --- a/src/Resources/Resources.Test/ScenarioTests/Common.ps1 +++ b/src/Resources/Resources.Test/ScenarioTests/Common.ps1 @@ -313,7 +313,7 @@ function Test-AzResourceGroupDeploymentWithName [string] [Parameter()] $TemplateParameterUri, [string] [Parameter()] $ApiVersion, [switch] [Parameter()] $RollbackToLastDeployment, - [switch] [Parameter()] $IgnoreDynamicParameters, + [switch] [Parameter()] $SkipTemplateParameterPrompt, [switch] [Parameter()] $Pre, [hashtable] [Parameter()] $TemplateObject, [hashtable] [Parameter()] $TemplateParameterObject, @@ -370,9 +370,9 @@ function Test-AzResourceGroupDeploymentWithName $cmdlet.RollbackToLastDeployment = $true } - if ($IgnoreDynamicParameters.IsPresent) + if ($SkipTemplateParameterPrompt.IsPresent) { - $cmdlet.IgnoreDynamicParameters = $true + $cmdlet.SkipTemplateParameterPrompt = $true } if ($Pre.IsPresent) diff --git a/src/Resources/Resources.Test/ScenarioTests/DeploymentTests.ps1 b/src/Resources/Resources.Test/ScenarioTests/DeploymentTests.ps1 index c3570866ab71..46f442692bb4 100644 --- a/src/Resources/Resources.Test/ScenarioTests/DeploymentTests.ps1 +++ b/src/Resources/Resources.Test/ScenarioTests/DeploymentTests.ps1 @@ -122,7 +122,7 @@ function Test-TestResourceGroupDeploymentErrors # Test # Catch exception when parameter template is missing New-AzResourceGroup -Name $rgname -Location $rglocation - $result = Test-AzResourceGroupDeploymentWithName -DeploymentName $deploymentName -ResourceGroupName $rgname -TemplateFile sampleDeploymentTemplate.json -IgnoreDynamicParameters + $result = Test-AzResourceGroupDeploymentWithName -DeploymentName $deploymentName -ResourceGroupName $rgname -TemplateFile sampleDeploymentTemplate.json -SkipTemplateParameterPrompt Assert-NotNull $result Assert-AreEqual "InvalidTemplate" $result.Code Assert-StartsWith "Deployment template validation failed" $result.Message diff --git a/src/Resources/Resources/help/New-AzDeployment.md b/src/Resources/Resources/help/New-AzDeployment.md index 57c4d5e67b7c..55e41273dbd6 100644 --- a/src/Resources/Resources/help/New-AzDeployment.md +++ b/src/Resources/Resources/help/New-AzDeployment.md @@ -15,14 +15,14 @@ Create a deployment ### ByTemplateFileWithNoParameters (Default) ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateFile [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] + -TemplateFile [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### ByTemplateObjectAndParameterObject ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateParameterObject -TemplateObject [-IgnoreDynamicParameters] + -TemplateParameterObject -TemplateObject [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -30,70 +30,74 @@ New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel < ### ByTemplateFileAndParameterObject ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateParameterObject -TemplateFile [-IgnoreDynamicParameters] [-ApiVersion ] - [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] + -TemplateParameterObject -TemplateFile [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ByTemplateUriAndParameterObject ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateParameterObject -TemplateUri [-IgnoreDynamicParameters] [-ApiVersion ] - [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] + -TemplateParameterObject -TemplateUri [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ByTemplateObjectAndParameterFile ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateParameterFile -TemplateObject [-IgnoreDynamicParameters] [-ApiVersion ] - [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] + -TemplateParameterFile -TemplateObject [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ByTemplateFileAndParameterFile ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateParameterFile -TemplateFile [-IgnoreDynamicParameters] [-ApiVersion ] + -TemplateParameterFile -TemplateFile [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### ByTemplateUriAndParameterFile ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateParameterFile -TemplateUri [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + -TemplateParameterFile -TemplateUri [-SkipTemplateParameterPrompt] [-ApiVersion ] + [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### ByTemplateObjectAndParameterUri ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateParameterUri -TemplateObject [-IgnoreDynamicParameters] [-ApiVersion ] - [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] + -TemplateParameterUri -TemplateObject [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] + [] ``` ### ByTemplateFileAndParameterUri ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateParameterUri -TemplateFile [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + -TemplateParameterUri -TemplateFile [-SkipTemplateParameterPrompt] [-ApiVersion ] + [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### ByTemplateUriAndParameterUri ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateParameterUri -TemplateUri [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] - [-DefaultProfile ] [-WhatIf] [-Confirm] [] + -TemplateParameterUri -TemplateUri [-SkipTemplateParameterPrompt] [-ApiVersion ] + [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### ByTemplateObjectWithNoParameters ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateObject [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] + -TemplateObject [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ### ByTemplateUriWithNoParameters ``` New-AzDeployment [-Name ] -Location [-DeploymentDebugLogLevel ] [-AsJob] - -TemplateUri [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] + -TemplateUri [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -204,21 +208,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -IgnoreDynamicParameters -Skip resolving dynamic parameters; this should be used when running a script or running this command as a job. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -Location The location to store deployment data. @@ -266,6 +255,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -SkipTemplateParameterPrompt +Skips the PowerShell dynamic parameter processing that checks if the provided template parameter contains all necessary parameters used by the template. This check would prompt the user to provide a value for the missing parameters, but providing the -SkipTemplateParameterPrompt will ignore this prompt and error out immediately if a parameter was found not to be bound in the template. For non-interactive scripts, -SkipTemplateParameterPrompt can be provided to avoid generic error messages from being thrown. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -TemplateFile Local path to the template file. diff --git a/src/Resources/Resources/help/New-AzResourceGroupDeployment.md b/src/Resources/Resources/help/New-AzResourceGroupDeployment.md index 4b762e0e1f1c..00279bba7103 100644 --- a/src/Resources/Resources/help/New-AzResourceGroupDeployment.md +++ b/src/Resources/Resources/help/New-AzResourceGroupDeployment.md @@ -17,7 +17,7 @@ Adds an Azure deployment to a resource group. ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateFile [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] + [-AsJob] -TemplateFile [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -25,7 +25,7 @@ New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mod ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateParameterObject -TemplateObject [-IgnoreDynamicParameters] + [-AsJob] -TemplateParameterObject -TemplateObject [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -34,7 +34,7 @@ New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mod ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateParameterObject -TemplateFile [-IgnoreDynamicParameters] + [-AsJob] -TemplateParameterObject -TemplateFile [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -43,7 +43,7 @@ New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mod ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateParameterObject -TemplateUri [-IgnoreDynamicParameters] + [-AsJob] -TemplateParameterObject -TemplateUri [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -52,7 +52,7 @@ New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mod ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateParameterFile -TemplateObject [-IgnoreDynamicParameters] + [-AsJob] -TemplateParameterFile -TemplateObject [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -61,7 +61,7 @@ New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mod ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateParameterFile -TemplateFile [-IgnoreDynamicParameters] + [-AsJob] -TemplateParameterFile -TemplateFile [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -70,7 +70,7 @@ New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mod ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateParameterFile -TemplateUri [-IgnoreDynamicParameters] + [-AsJob] -TemplateParameterFile -TemplateUri [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -79,7 +79,7 @@ New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mod ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateParameterUri -TemplateObject [-IgnoreDynamicParameters] + [-AsJob] -TemplateParameterUri -TemplateObject [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -88,7 +88,7 @@ New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mod ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateParameterUri -TemplateFile [-IgnoreDynamicParameters] + [-AsJob] -TemplateParameterUri -TemplateFile [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -97,7 +97,7 @@ New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mod ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateParameterUri -TemplateUri [-IgnoreDynamicParameters] + [-AsJob] -TemplateParameterUri -TemplateUri [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -106,7 +106,7 @@ New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mod ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateObject [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] + [-AsJob] -TemplateObject [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -114,7 +114,7 @@ New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mod ``` New-AzResourceGroupDeployment [-Name ] -ResourceGroupName [-Mode ] [-DeploymentDebugLogLevel ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] [-Force] - [-AsJob] -TemplateUri [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] + [-AsJob] -TemplateUri [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -242,21 +242,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -IgnoreDynamicParameters -Skip resolving dynamic parameters; this should be used when running a script or running this command as a job. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -Mode Specifies the deployment mode. The acceptable values for this parameter are: - Complete @@ -353,6 +338,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -SkipTemplateParameterPrompt +Skips the PowerShell dynamic parameter processing that checks if the provided template parameter contains all necessary parameters used by the template. This check would prompt the user to provide a value for the missing parameters, but providing the -SkipTemplateParameterPrompt will ignore this prompt and error out immediately if a parameter was found not to be bound in the template. For non-interactive scripts, -SkipTemplateParameterPrompt can be provided to avoid generic error messages from being thrown. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -TemplateFile Specifies the full path of a JSON template file. This can be a custom template or a gallery template that is saved as a JSON file, such as one created by using the **Save-AzResourceGroupGalleryTemplate** cmdlet. diff --git a/src/Resources/Resources/help/Test-AzDeployment.md b/src/Resources/Resources/help/Test-AzDeployment.md index 1e941befbbbe..cf1f34742391 100644 --- a/src/Resources/Resources/help/Test-AzDeployment.md +++ b/src/Resources/Resources/help/Test-AzDeployment.md @@ -14,83 +14,83 @@ Validates a deployment. ### ByTemplateFileWithNoParameters (Default) ``` -Test-AzDeployment -Location -TemplateFile [-IgnoreDynamicParameters] [-ApiVersion ] - [-Pre] [-DefaultProfile ] [] +Test-AzDeployment -Location -TemplateFile [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ### ByTemplateObjectAndParameterObject ``` Test-AzDeployment -Location -TemplateParameterObject -TemplateObject - [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ### ByTemplateFileAndParameterObject ``` Test-AzDeployment -Location -TemplateParameterObject -TemplateFile - [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ### ByTemplateUriAndParameterObject ``` Test-AzDeployment -Location -TemplateParameterObject -TemplateUri - [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ### ByTemplateObjectAndParameterFile ``` Test-AzDeployment -Location -TemplateParameterFile -TemplateObject - [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ### ByTemplateFileAndParameterFile ``` Test-AzDeployment -Location -TemplateParameterFile -TemplateFile - [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ### ByTemplateUriAndParameterFile ``` Test-AzDeployment -Location -TemplateParameterFile -TemplateUri - [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ### ByTemplateObjectAndParameterUri ``` Test-AzDeployment -Location -TemplateParameterUri -TemplateObject - [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ### ByTemplateFileAndParameterUri ``` Test-AzDeployment -Location -TemplateParameterUri -TemplateFile - [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ### ByTemplateUriAndParameterUri ``` Test-AzDeployment -Location -TemplateParameterUri -TemplateUri - [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ### ByTemplateObjectWithNoParameters ``` -Test-AzDeployment -Location -TemplateObject [-IgnoreDynamicParameters] +Test-AzDeployment -Location -TemplateObject [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ### ByTemplateUriWithNoParameters ``` -Test-AzDeployment -Location -TemplateUri [-IgnoreDynamicParameters] [-ApiVersion ] - [-Pre] [-DefaultProfile ] [] +Test-AzDeployment -Location -TemplateUri [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ## DESCRIPTION @@ -147,38 +147,38 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -IgnoreDynamicParameters -Skip resolving dynamic parameters; this should be used when running a script or running this command as a job. +### -Location +The location to store deployment data. ```yaml -Type: System.Management.Automation.SwitchParameter +Type: System.String Parameter Sets: (All) Aliases: -Required: False +Required: True Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -Location -The location to store deployment data. +### -Pre +When set, indicates that the cmdlet should use pre-release API versions when automatically determining which version to use. ```yaml -Type: System.String +Type: System.Management.Automation.SwitchParameter Parameter Sets: (All) Aliases: -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -Pre -When set, indicates that the cmdlet should use pre-release API versions when automatically determining which version to use. +### -SkipTemplateParameterPrompt +Skips the PowerShell dynamic parameter processing that checks if the provided template parameter contains all necessary parameters used by the template. This check would prompt the user to provide a value for the missing parameters, but providing the -SkipTemplateParameterPrompt will ignore this prompt and error out immediately if a parameter was found not to be bound in the template. For non-interactive scripts, -SkipTemplateParameterPrompt can be provided to avoid generic error messages from being thrown. ```yaml Type: System.Management.Automation.SwitchParameter diff --git a/src/Resources/Resources/help/Test-AzResourceGroupDeployment.md b/src/Resources/Resources/help/Test-AzResourceGroupDeployment.md index be16ac459e8d..02fceb1f532f 100644 --- a/src/Resources/Resources/help/Test-AzResourceGroupDeployment.md +++ b/src/Resources/Resources/help/Test-AzResourceGroupDeployment.md @@ -16,15 +16,15 @@ Validates a resource group deployment. ### ByTemplateFileWithNoParameters (Default) ``` Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [-RollbackToLastDeployment] - [-RollBackDeploymentName ] -TemplateFile [-IgnoreDynamicParameters] [-ApiVersion ] - [-Pre] [-DefaultProfile ] [] + [-RollBackDeploymentName ] -TemplateFile [-SkipTemplateParameterPrompt] + [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ### ByTemplateObjectAndParameterObject ``` Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] -TemplateParameterObject -TemplateObject - [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` @@ -32,7 +32,7 @@ Test-AzResourceGroupDeployment -ResourceGroupName [-Mode [-Mode ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] -TemplateParameterObject -TemplateFile - [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` @@ -40,7 +40,7 @@ Test-AzResourceGroupDeployment -ResourceGroupName [-Mode [-Mode ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] -TemplateParameterObject -TemplateUri - [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` @@ -48,7 +48,7 @@ Test-AzResourceGroupDeployment -ResourceGroupName [-Mode [-Mode ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] -TemplateParameterFile -TemplateObject - [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` @@ -56,7 +56,7 @@ Test-AzResourceGroupDeployment -ResourceGroupName [-Mode [-Mode ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] -TemplateParameterFile -TemplateFile - [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` @@ -64,7 +64,7 @@ Test-AzResourceGroupDeployment -ResourceGroupName [-Mode [-Mode ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] -TemplateParameterFile -TemplateUri - [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` @@ -72,7 +72,7 @@ Test-AzResourceGroupDeployment -ResourceGroupName [-Mode [-Mode ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] -TemplateParameterUri -TemplateObject - [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` @@ -80,7 +80,7 @@ Test-AzResourceGroupDeployment -ResourceGroupName [-Mode [-Mode ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] -TemplateParameterUri -TemplateFile - [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` @@ -88,21 +88,21 @@ Test-AzResourceGroupDeployment -ResourceGroupName [-Mode [-Mode ] [-RollbackToLastDeployment] [-RollBackDeploymentName ] -TemplateParameterUri -TemplateUri - [-IgnoreDynamicParameters] [-ApiVersion ] [-Pre] [-DefaultProfile ] + [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ### ByTemplateObjectWithNoParameters ``` Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [-RollbackToLastDeployment] - [-RollBackDeploymentName ] -TemplateObject [-IgnoreDynamicParameters] + [-RollBackDeploymentName ] -TemplateObject [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` ### ByTemplateUriWithNoParameters ``` Test-AzResourceGroupDeployment -ResourceGroupName [-Mode ] [-RollbackToLastDeployment] - [-RollBackDeploymentName ] -TemplateUri [-IgnoreDynamicParameters] [-ApiVersion ] + [-RollBackDeploymentName ] -TemplateUri [-SkipTemplateParameterPrompt] [-ApiVersion ] [-Pre] [-DefaultProfile ] [] ``` @@ -153,21 +153,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -IgnoreDynamicParameters -Skip resolving dynamic parameters; this should be used when running a script or running this command as a job. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -Mode Specifies the deployment mode. The acceptable values for this parameter are: @@ -247,6 +232,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -SkipTemplateParameterPrompt +Skips the PowerShell dynamic parameter processing that checks if the provided template parameter contains all necessary parameters used by the template. This check would prompt the user to provide a value for the missing parameters, but providing the -SkipTemplateParameterPrompt will ignore this prompt and error out immediately if a parameter was found not to be bound in the template. For non-interactive scripts, -SkipTemplateParameterPrompt can be provided to avoid generic error messages from being thrown. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -TemplateFile Specifies the full path of a JSON template file. diff --git a/tools/StaticAnalysis/Exceptions/Az.Resources/SignatureIssues.csv b/tools/StaticAnalysis/Exceptions/Az.Resources/SignatureIssues.csv index 0a5737f051e9..fd98f5b15d02 100644 --- a/tools/StaticAnalysis/Exceptions/Az.Resources/SignatureIssues.csv +++ b/tools/StaticAnalysis/Exceptions/Az.Resources/SignatureIssues.csv @@ -26,8 +26,4 @@ "Microsoft.Azure.PowerShell.Cmdlets.ResourceManager.Cmdlets.dll","Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.SetAzureResourceCmdlet","Set-AzResource","1","8410","Parameter UsePatchSemantics of cmdlet Set-AzResource does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name." "Microsoft.Azure.PowerShell.Cmdlets.ResourceManager.Cmdlets.dll","Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceCmdlet","New-AzResource","1","8410","Parameter Properties of cmdlet New-AzResource does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name." "Microsoft.Azure.PowerShell.Cmdlets.ResourceManager.Cmdlets.dll","Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.SetAzureResourceLockCmdlet","Set-AzResourceLock","1","8410","Parameter LockNotes of cmdlet Set-AzResourceLock does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name." -"Microsoft.Azure.PowerShell.Cmdlets.ResourceManager.Cmdlets.dll","Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.GetAzureResourceCmdlet","Get-AzResource","1","8410","Parameter ExpandProperties of cmdlet Get-AzResource does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name." -"Microsoft.Azure.PowerShell.Cmdlets.ResourceManager.dll","Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureDeploymentCmdlet","New-AzDeployment","1","8410","Parameter IgnoreDynamicParameters of cmdlet New-AzDeployment does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name." -"Microsoft.Azure.PowerShell.Cmdlets.ResourceManager.dll","Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.TestAzureDeploymentCmdlet","Test-AzDeployment","1","8410","Parameter IgnoreDynamicParameters of cmdlet Test-AzDeployment does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name." -"Microsoft.Azure.PowerShell.Cmdlets.ResourceManager.dll","Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet","New-AzResourceGroupDeployment","1","8410","Parameter IgnoreDynamicParameters of cmdlet New-AzResourceGroupDeployment does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name." -"Microsoft.Azure.PowerShell.Cmdlets.ResourceManager.dll","Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.TestAzureResourceGroupDeploymentCmdlet","Test-AzResourceGroupDeployment","1","8410","Parameter IgnoreDynamicParameters of cmdlet Test-AzResourceGroupDeployment does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name." \ No newline at end of file +"Microsoft.Azure.PowerShell.Cmdlets.ResourceManager.Cmdlets.dll","Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.GetAzureResourceCmdlet","Get-AzResource","1","8410","Parameter ExpandProperties of cmdlet Get-AzResource does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name." \ No newline at end of file