Skip to content

Commit 89a4dae

Browse files
dannysonggLei jin
authored andcommitted
Fix bug to allow params to be toggled off
Update ChangeLog
1 parent 3b49cdc commit 89a4dae

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/Websites/Websites/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Fix bug where parameters could not be set to false for `Publish-AzWebApp`
2122

2223
## Version 3.2.1
2324
* Introduced secrets detection feature to safeguard sensitive data.

src/Websites/Websites/Cmdlets/WebApps/PublishAzureWebApp.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,33 +119,34 @@ public override void ExecuteCmdlet()
119119

120120
paramValues.Add("path", TargetPath);
121121

122+
// Purposely using IsParameterBound to check if the parameter is passed or not. In this case we want to return true if $false is passed.
123+
// We only want to set the parameter if a value is passed.
122124
// default async to true if not provided to match old behavior
123-
if (Async.IsPresent)
125+
if (this.IsParameterBound(c => c.Async))
124126
{
125127
paramValues.Add("async", Async.ToString());
126128
}
127-
128129
else
129130
{
130131
paramValues.Add("async", "true");
131132
}
132133

133-
if (Restart.IsPresent)
134+
if (this.IsParameterBound(c => c.Restart))
134135
{
135136
paramValues.Add("restart", Restart.ToString());
136137
}
137138

138-
if (Clean.IsPresent)
139+
if (this.IsParameterBound(c => c.Clean))
139140
{
140141
paramValues.Add("clean", Clean.ToString());
141142
}
142143

143-
if (IgnoreStack.IsPresent)
144+
if (this.IsParameterBound(c => c.IgnoreStack))
144145
{
145146
paramValues.Add("ignorestack", IgnoreStack.ToString());
146147
}
147148

148-
if (Reset.IsPresent)
149+
if (this.IsParameterBound(c => c.Reset))
149150
{
150151
paramValues.Add("reset", Reset.ToString());
151152
}

0 commit comments

Comments
 (0)