Skip to content

Commit 42e737f

Browse files
authored
[Resources] Bugfix New-Az*DeploymentStacks cmdlets conditional change (#22462)
* bugfix for conditional change in stacks New cmdlets * added changelog entry * adjusted changelog * adjusted changelog to remove version
1 parent 8efcd2a commit 42e737f

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

src/Resources/ResourceManager/Implementation/DeploymentStacks/NewAzManagementGroupDeploymentStack.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ protected override void OnProcessRecord()
230230
WriteObject(deploymentStack);
231231
};
232232

233-
if (!Force.IsPresent && currentStack == null)
233+
if (!Force.IsPresent && currentStack != null)
234234
{
235235
string confirmationMessage = $"The DeploymentStack '{Name}' you're trying to create already exists in ManagementGroup '{ManagementGroupId}'. " +
236236
$"Do you want to overwrite it\n?" +

src/Resources/ResourceManager/Implementation/DeploymentStacks/NewAzResourceGroupDeploymentStack.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ protected override void OnProcessRecord()
217217
WriteObject(deploymentStack);
218218
};
219219

220-
if (!Force.IsPresent && currentStack == null)
220+
if (!Force.IsPresent && currentStack != null)
221221
{
222222
string confirmationMessage = $"The DeploymentStack '{Name}' you're trying to create already exists in ResourceGroup '{ResourceGroupName}'. " +
223223
$"Do you want to overwrite it?\n" +

src/Resources/ResourceManager/Implementation/DeploymentStacks/NewAzSubscriptionDeploymentStack.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ protected override void OnProcessRecord()
224224
WriteObject(deploymentStack);
225225
};
226226

227-
if (!Force.IsPresent && currentStack == null)
227+
if (!Force.IsPresent && currentStack != null)
228228
{
229229

230230
string confirmationMessage = $"The DeploymentStack '{Name}' you're trying to create already exists in the current subscription. " +

src/Resources/Resources/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
-->
2020

2121
## Upcoming Release
22+
* Fixed the warning prompt condition check in New-Az*DeploymentStack cmdlets.
2223

2324
## Version 6.9.0
2425
* Fixed the issue that `New-AzRoleAssignment` didn't work without subscription.

0 commit comments

Comments
 (0)