Skip to content

Commit

Permalink
Allow to specify deployment name for validate on management group, su…
Browse files Browse the repository at this point in the history
…bscription, and tenant deployments
  • Loading branch information
jontreynes committed May 21, 2021
1 parent f71f46e commit 52c7596
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
[Cmdlet(VerbsDiagnostic.Test, AzureRMConstants.AzureRMPrefix + "ManagementGroupDeployment", DefaultParameterSetName = ParameterlessTemplateFileParameterSetName), OutputType(typeof(PSResourceManagerError))]
public class TestAzureManagementGroupDeploymentCmdlet : TestDeploymentCmdletBase
{
[Alias("DeploymentName")]
[Parameter(Mandatory = false,
HelpMessage = "The name of the deployment it's going to create. If not specified, defaults to the template file name when a template file is provided; defaults to the current time when a template object is provided, e.g. \"20131223140835\".")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

[Parameter(Mandatory = true, HelpMessage = "The management group id.")]
[ValidateNotNullOrEmpty]
public string ManagementGroupId { get; set; }
Expand All @@ -44,6 +50,7 @@ protected override void OnProcessRecord()
ScopeType = DeploymentScopeType.ManagementGroup,
ManagementGroupId = this.ManagementGroupId,
Location = this.Location,
DeploymentName = this.Name,
QueryString = QueryString,
TemplateFile = this.TemplateUri ?? this.TryResolvePath(this.TemplateFile),
TemplateObject = this.TemplateObject,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
DefaultParameterSetName = ParameterlessTemplateFileParameterSetName), OutputType(typeof(PSResourceManagerError))]
public class TestAzureTenantDeploymentCmdlet : TestDeploymentCmdletBase
{
[Alias("DeploymentName")]
[Parameter(Mandatory = false,
HelpMessage = "The name of the deployment it's going to create. If not specified, defaults to the template file name when a template file is provided; defaults to the current time when a template object is provided, e.g. \"20131223140835\".")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }

[Parameter(Mandatory = true, HelpMessage = "The location to store deployment data.")]
[LocationCompleter("Microsoft.Resources/resourceGroups")]
[ValidateNotNullOrEmpty]
Expand All @@ -40,6 +46,7 @@ protected override void OnProcessRecord()
{
ScopeType = DeploymentScopeType.Tenant,
Location = this.Location,
DeploymentName = this.Name,
TemplateFile = this.TemplateUri ?? this.TryResolvePath(this.TemplateFile),
TemplateObject = this.TemplateObject,
QueryString = QueryString,
Expand Down

0 comments on commit 52c7596

Please sign in to comment.