Skip to content

Commit c19e6d1

Browse files
Ptnan7Jingnan Xu
andauthored
fix front door ternary operator issue (#28831)
Co-authored-by: Jingnan Xu <jingnanxu@microsoft.com>
1 parent 5ad3fa2 commit c19e6d1

9 files changed

+90
-34
lines changed

src/FrontDoor/FrontDoor.Autorest/custom/New-AzFrontDoorBackendPoolsSettingObject.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Create an in-memory object for BackendPoolsSettings.
2323
.Outputs
2424
Microsoft.Azure.PowerShell.Cmdlets.FrontDoor.Models.BackendPoolsSettings
2525
.Link
26-
https://learn.microsoft.com/powershell/module/Az.FrontDoor/new-azfrontdoorbackendpoolssettingsobject
26+
https://learn.microsoft.com/powershell/module/Az.FrontDoor/new-azfrontdoorbackendpoolssettingobject
2727
#>
2828
function New-AzFrontDoorBackendPoolsSettingObject {
2929
[Microsoft.Azure.PowerShell.Cmdlets.FrontDoor.ModelCmdletAttribute()]

src/FrontDoor/FrontDoor.Autorest/custom/New-AzFrontDoorRoutingRuleObject.ps1

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,30 @@ function New-AzFrontDoorRoutingRuleObject {
140140
if ($PSBoundParameters.ContainsKey('CacheDuration')) {
141141
$CacheConfiguration.CacheDuration = $CacheDuration
142142
}
143-
$CacheConfiguration.DynamicCompression = $PSBoundParameters.ContainsKey('DynamicCompression')? $DynamicCompression : 'Enabled'
143+
if ($PSBoundParameters.ContainsKey('DynamicCompression')) {
144+
$CacheConfiguration.DynamicCompression = $DynamicCompression
145+
} else {
146+
$CacheConfiguration.DynamicCompression = 'Enabled'
147+
}
144148
if ($PSBoundParameters.ContainsKey('QueryParameter')) {
145149
$CacheConfiguration.QueryParameter = $QueryParameter
146150
}
147-
$CacheConfiguration.QueryParameterStripDirective = $PSBoundParameters.ContainsKey('QueryParameterStripDirective')? $QueryParameterStripDirective : 'StripAll'
151+
if ($PSBoundParameters.ContainsKey('QueryParameterStripDirective')) {
152+
$CacheConfiguration.QueryParameterStripDirective = $QueryParameterStripDirective
153+
} else {
154+
$CacheConfiguration.QueryParameterStripDirective = 'StripAll'
155+
}
148156
$ForwardingConfiguration.CacheConfiguration = $CacheConfiguration
149157
}
150158

151159
if ($PSBoundParameters.ContainsKey('CustomForwardingPath')) {
152160
$ForwardingConfiguration.CustomForwardingPath = $CustomForwardingPath
153161
}
154-
$ForwardingConfiguration.ForwardingProtocol = $PSBoundParameters.ContainsKey('ForwardingProtocol')? $ForwardingProtocol : 'MatchRequest'
162+
if ($PSBoundParameters.ContainsKey('ForwardingProtocol')) {
163+
$ForwardingConfiguration.ForwardingProtocol = $ForwardingProtocol
164+
} else {
165+
$ForwardingConfiguration.ForwardingProtocol = 'MatchRequest'
166+
}
155167
$Object.RouteConfiguration = $ForwardingConfiguration
156168
}
157169
"ByFieldsWithRedirectParameterSet" {
@@ -160,13 +172,29 @@ function New-AzFrontDoorRoutingRuleObject {
160172
if ($PSBoundParameters.ContainsKey('CustomFragment')) {
161173
$RedirectConfiguration.CustomFragment = $CustomFragment
162174
}
163-
$RedirectConfiguration.CustomHost = $PSBoundParameters.ContainsKey('CustomHost')? $CustomHost : ''
164-
$RedirectConfiguration.CustomPath = $PSBoundParameters.ContainsKey('CustomPath')? $CustomPath : ''
175+
if ($PSBoundParameters.ContainsKey('CustomHost')) {
176+
$RedirectConfiguration.CustomHost = $CustomHost
177+
} else {
178+
$RedirectConfiguration.CustomHost = ''
179+
}
180+
if ($PSBoundParameters.ContainsKey('CustomPath')) {
181+
$RedirectConfiguration.CustomPath = $CustomPath
182+
} else {
183+
$RedirectConfiguration.CustomPath = ''
184+
}
165185
if ($PSBoundParameters.ContainsKey('CustomQueryString')) {
166186
$RedirectConfiguration.CustomQueryString = $CustomQueryString
167187
}
168-
$RedirectConfiguration.RedirectProtocol = $PSBoundParameters.ContainsKey('RedirectProtocol')? $RedirectProtocol : 'MatchRequest'
169-
$RedirectConfiguration.RedirectType = $PSBoundParameters.ContainsKey('RedirectType')? $RedirectType : 'Moved'
188+
if ($PSBoundParameters.ContainsKey('RedirectProtocol')) {
189+
$RedirectConfiguration.RedirectProtocol = $RedirectProtocol
190+
} else {
191+
$RedirectConfiguration.RedirectProtocol = 'MatchRequest'
192+
}
193+
if ($PSBoundParameters.ContainsKey('RedirectType')) {
194+
$RedirectConfiguration.RedirectType = $RedirectType
195+
} else {
196+
$RedirectConfiguration.RedirectType = 'Moved'
197+
}
170198

171199
$Object.RouteConfiguration = $RedirectConfiguration
172200
}

src/FrontDoor/FrontDoor.Autorest/custom/New-AzFrontDoorRulesEngineActionObject.ps1

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,30 @@ function New-AzFrontDoorRulesEngineActionObject {
143143
if ($PSBoundParameters.ContainsKey('CacheDuration')) {
144144
$CacheConfiguration.CacheDuration = $CacheDuration
145145
}
146-
$CacheConfiguration.DynamicCompression = $PSBoundParameters.ContainsKey('DynamicCompression')? $DynamicCompression : 'Enabled'
146+
if ($PSBoundParameters.ContainsKey('DynamicCompression')) {
147+
$CacheConfiguration.DynamicCompression = $DynamicCompression
148+
} else {
149+
$CacheConfiguration.DynamicCompression = 'Enabled'
150+
}
147151
if ($PSBoundParameters.ContainsKey('QueryParameter')) {
148152
$CacheConfiguration.QueryParameter = $QueryParameter
149153
}
150-
$CacheConfiguration.QueryParameterStripDirective = $PSBoundParameters.ContainsKey('QueryParameterStripDirective')? $QueryParameterStripDirective : 'StripAll'
154+
if ($PSBoundParameters.ContainsKey('QueryParameterStripDirective')) {
155+
$CacheConfiguration.QueryParameterStripDirective = $QueryParameterStripDirective
156+
} else {
157+
$CacheConfiguration.QueryParameterStripDirective = 'StripAll'
158+
}
151159
$ForwardingConfiguration.CacheConfiguration = $CacheConfiguration
152160
}
153161

154162
if ($PSBoundParameters.ContainsKey('CustomForwardingPath')) {
155163
$ForwardingConfiguration.CustomForwardingPath = $CustomForwardingPath
156164
}
157-
$ForwardingConfiguration.ForwardingProtocol = $PSBoundParameters.ContainsKey('ForwardingProtocol')? $ForwardingProtocol : 'MatchRequest'
165+
if ($PSBoundParameters.ContainsKey('ForwardingProtocol')) {
166+
$ForwardingConfiguration.ForwardingProtocol = $ForwardingProtocol
167+
} else {
168+
$ForwardingConfiguration.ForwardingProtocol = 'MatchRequest'
169+
}
158170

159171
$Object.RouteConfigurationOverride = $ForwardingConfiguration
160172
break
@@ -165,13 +177,29 @@ function New-AzFrontDoorRulesEngineActionObject {
165177
if ($PSBoundParameters.ContainsKey('CustomFragment')) {
166178
$RedirectConfiguration.CustomFragment = $CustomFragment
167179
}
168-
$RedirectConfiguration.CustomHost = $PSBoundParameters.ContainsKey('CustomHost')? $CustomHost : ''
169-
$RedirectConfiguration.CustomPath = $PSBoundParameters.ContainsKey('CustomPath')? $CustomPath : ''
180+
if ($PSBoundParameters.ContainsKey('CustomHost')) {
181+
$RedirectConfiguration.CustomHost = $CustomHost
182+
} else {
183+
$RedirectConfiguration.CustomHost = ''
184+
}
185+
if ($PSBoundParameters.ContainsKey('CustomPath')) {
186+
$RedirectConfiguration.CustomPath = $CustomPath
187+
} else {
188+
$RedirectConfiguration.CustomPath = ''
189+
}
170190
if ($PSBoundParameters.ContainsKey('CustomQueryString')) {
171191
$RedirectConfiguration.CustomQueryString = $CustomQueryString
172192
}
173-
$RedirectConfiguration.RedirectProtocol = $PSBoundParameters.ContainsKey('RedirectProtocol')? $RedirectProtocol : 'MatchRequest'
174-
$RedirectConfiguration.RedirectType = $PSBoundParameters.ContainsKey('RedirectType')? $RedirectType : 'Moved'
193+
if ($PSBoundParameters.ContainsKey('RedirectProtocol')) {
194+
$RedirectConfiguration.RedirectProtocol = $RedirectProtocol
195+
} else {
196+
$RedirectConfiguration.RedirectProtocol = 'MatchRequest'
197+
}
198+
if ($PSBoundParameters.ContainsKey('RedirectType')) {
199+
$RedirectConfiguration.RedirectType = $RedirectType
200+
} else {
201+
$RedirectConfiguration.RedirectType = 'Moved'
202+
}
175203

176204
$Object.RouteConfigurationOverride = $RedirectConfiguration
177205
break

src/FrontDoor/FrontDoor.Autorest/docs/Az.FrontDoor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.FrontDoor
3-
Module Guid: 2137812d-57b1-4758-b545-30ae71638628
3+
Module Guid: de841666-09d0-4c1e-a6ad-b3112699a6c2
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.frontdoor
55
Help Version: 1.0.0.0
66
Locale: en-US

src/FrontDoor/FrontDoor.Autorest/docs/New-AzFrontDoorBackendPoolsSettingObject.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file:
33
Module Name: Az.FrontDoor
4-
online version: https://learn.microsoft.com/powershell/module/Az.FrontDoor/new-azfrontdoorbackendpoolssettingsobject
4+
online version: https://learn.microsoft.com/powershell/module/Az.FrontDoor/new-azfrontdoorbackendpoolssettingobject
55
schema: 2.0.0
66
---
77

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"generate_Id": "a7e2b3f2-93da-4267-9884-a33f03f9fef1"
2+
"generate_Id": "d1340c55-8f29-452b-8617-778ef1c3ce8d"
33
}

src/FrontDoor/FrontDoor.sln

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestFx", "..\..\tools\TestF
2323
EndProject
2424
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FrontDoor.Autorest", "FrontDoor.Autorest", "{CCB5835C-B2B2-6D15-3546-15EE6FE0A6E7}"
2525
EndProject
26-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.FrontDoor", "..\..\generated\FrontDoor\FrontDoor.Autorest\Az.FrontDoor.csproj", "{45CA8110-3D84-42EB-897D-CBBA1BEAF930}"
26+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.FrontDoor", "..\..\generated\FrontDoor\FrontDoor.Autorest\Az.FrontDoor.csproj", "{B0D8665E-838F-41FB-AC8D-FD727F5F0E27}"
2727
EndProject
2828
Global
2929
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -131,18 +131,18 @@ Global
131131
{CEE04FC4-EA9E-49F5-8E65-1BF927763971}.Release|x64.Build.0 = Release|Any CPU
132132
{CEE04FC4-EA9E-49F5-8E65-1BF927763971}.Release|x86.ActiveCfg = Release|Any CPU
133133
{CEE04FC4-EA9E-49F5-8E65-1BF927763971}.Release|x86.Build.0 = Release|Any CPU
134-
{45CA8110-3D84-42EB-897D-CBBA1BEAF930}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
135-
{45CA8110-3D84-42EB-897D-CBBA1BEAF930}.Debug|Any CPU.Build.0 = Debug|Any CPU
136-
{45CA8110-3D84-42EB-897D-CBBA1BEAF930}.Debug|x64.ActiveCfg = Debug|Any CPU
137-
{45CA8110-3D84-42EB-897D-CBBA1BEAF930}.Debug|x64.Build.0 = Debug|Any CPU
138-
{45CA8110-3D84-42EB-897D-CBBA1BEAF930}.Debug|x86.ActiveCfg = Debug|Any CPU
139-
{45CA8110-3D84-42EB-897D-CBBA1BEAF930}.Debug|x86.Build.0 = Debug|Any CPU
140-
{45CA8110-3D84-42EB-897D-CBBA1BEAF930}.Release|Any CPU.ActiveCfg = Release|Any CPU
141-
{45CA8110-3D84-42EB-897D-CBBA1BEAF930}.Release|Any CPU.Build.0 = Release|Any CPU
142-
{45CA8110-3D84-42EB-897D-CBBA1BEAF930}.Release|x64.ActiveCfg = Release|Any CPU
143-
{45CA8110-3D84-42EB-897D-CBBA1BEAF930}.Release|x64.Build.0 = Release|Any CPU
144-
{45CA8110-3D84-42EB-897D-CBBA1BEAF930}.Release|x86.ActiveCfg = Release|Any CPU
145-
{45CA8110-3D84-42EB-897D-CBBA1BEAF930}.Release|x86.Build.0 = Release|Any CPU
134+
{B0D8665E-838F-41FB-AC8D-FD727F5F0E27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
135+
{B0D8665E-838F-41FB-AC8D-FD727F5F0E27}.Debug|Any CPU.Build.0 = Debug|Any CPU
136+
{B0D8665E-838F-41FB-AC8D-FD727F5F0E27}.Debug|x64.ActiveCfg = Debug|Any CPU
137+
{B0D8665E-838F-41FB-AC8D-FD727F5F0E27}.Debug|x64.Build.0 = Debug|Any CPU
138+
{B0D8665E-838F-41FB-AC8D-FD727F5F0E27}.Debug|x86.ActiveCfg = Debug|Any CPU
139+
{B0D8665E-838F-41FB-AC8D-FD727F5F0E27}.Debug|x86.Build.0 = Debug|Any CPU
140+
{B0D8665E-838F-41FB-AC8D-FD727F5F0E27}.Release|Any CPU.ActiveCfg = Release|Any CPU
141+
{B0D8665E-838F-41FB-AC8D-FD727F5F0E27}.Release|Any CPU.Build.0 = Release|Any CPU
142+
{B0D8665E-838F-41FB-AC8D-FD727F5F0E27}.Release|x64.ActiveCfg = Release|Any CPU
143+
{B0D8665E-838F-41FB-AC8D-FD727F5F0E27}.Release|x64.Build.0 = Release|Any CPU
144+
{B0D8665E-838F-41FB-AC8D-FD727F5F0E27}.Release|x86.ActiveCfg = Release|Any CPU
145+
{B0D8665E-838F-41FB-AC8D-FD727F5F0E27}.Release|x86.Build.0 = Release|Any CPU
146146
EndGlobalSection
147147
GlobalSection(SolutionProperties) = preSolution
148148
HideSolutionNode = FALSE
@@ -154,7 +154,7 @@ Global
154154
{4A06E6FB-D5E9-48DF-9BFB-867FE814F47E} = {52103A11-029D-492B-87C7-22D39EF55958}
155155
{671E6476-CDED-43A3-AB46-1338DAB61409} = {52103A11-029D-492B-87C7-22D39EF55958}
156156
{31599FB7-7929-4E92-834F-A23C603A9116} = {52103A11-029D-492B-87C7-22D39EF55958}
157-
{45CA8110-3D84-42EB-897D-CBBA1BEAF930} = {CCB5835C-B2B2-6D15-3546-15EE6FE0A6E7}
157+
{B0D8665E-838F-41FB-AC8D-FD727F5F0E27} = {CCB5835C-B2B2-6D15-3546-15EE6FE0A6E7}
158158
EndGlobalSection
159159
GlobalSection(ExtensibilityGlobals) = postSolution
160160
SolutionGuid = {8030889A-062F-4BCC-8246-EC5BCEDCAF25}

src/FrontDoor/FrontDoor/Az.FrontDoor.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 2025/11/7
6+
# Generated on: 2025/11/10
77
#
88

99
@{

src/FrontDoor/FrontDoor/help/New-AzFrontDoorBackendPoolsSettingObject.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
external help file: Az.FrontDoor-help.xml
33
Module Name: Az.FrontDoor
4-
online version: https://learn.microsoft.com/powershell/module/az.frontdoor/new-azfrontdoorbackendpoolssettingobject
4+
online version: https://learn.microsoft.com/powershell/module/Az.FrontDoor/new-azfrontdoorbackendpoolssettingobject
55
schema: 2.0.0
66
---
77

0 commit comments

Comments
 (0)