Skip to content

Conversation

@isra-fel
Copy link
Member

@isra-fel isra-fel commented Nov 10, 2025

Description

Replace ternary operator (A ? B : C) in the customization code of FrontDoor as it is not supported by PS 5.1

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Copilot AI review requested due to automatic review settings November 10, 2025 00:16
@azure-client-tools-bot-prd
Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

@isra-fel isra-fel changed the title Replace ternary operator for PS 5.1 [FrontDoor] Replace ternary operator for PS 5.1 Nov 10, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves PowerShell 5.1 compatibility by replacing ternary operators (which require PowerShell 7.0+) with traditional if-else statements in two FrontDoor AutoRest cmdlets.

  • Replaced all ternary operators with if-else statements to ensure PowerShell 5.1 compatibility
  • The logic and default values are preserved correctly across all changes

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/FrontDoor/FrontDoor.Autorest/custom/New-AzFrontDoorRulesEngineActionObject.ps1 Replaced 7 ternary operators with if-else statements for parameter defaults (DynamicCompression, QueryParameterStripDirective, ForwardingProtocol, CustomHost, CustomPath, RedirectProtocol, RedirectType)
src/FrontDoor/FrontDoor.Autorest/custom/New-AzFrontDoorRoutingRuleObject.ps1 Replaced 7 ternary operators with if-else statements for parameter defaults (DynamicCompression, QueryParameterStripDirective, ForwardingProtocol, CustomHost, CustomPath, RedirectProtocol, RedirectType)

@isra-fel
Copy link
Member Author

Replaced by #28831

@isra-fel isra-fel closed this Nov 10, 2025
@isra-fel isra-fel deleted the frontdoor-ternary branch November 10, 2025 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant