Skip to content

Use -or operator in New-PrivateSiteExtension.ps1 #11138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2025

Conversation

castrodd
Copy link
Member

Issue describing the changes in this PR

Our release pipeline for the Host started failing to create the PrivateSiteExtension. When we looked at the logs, we saw the following line:

Published private site extension to .zip

Normally, this would be something like:

Published private site extension to Functions.Private.4.1040.300.win-x86.zip

I could see that this log was coming from the last line of the script. This suggested that there was an issue with the $OutputPath.

When I ran the script locally, I could see that $OutputPath was never getting set. After some trial and error, I was able to pin it down to the line being modified in this PR. This condition was not resolving to true, even though both $AppendOutputName and $OutputPath are null at that point in the script and therefore !$OutputPath should be equal to true.

When I ran the script with the -or operator instead of ||, the script worked as expected and the $OutputPath was set correctly.

Pull request checklist

IMPORTANT: Currently, changes must be backported to the in-proc branch to be included in Core Tools and non-Flex deployments.

  • Backporting to the in-proc branch is not required
    • Otherwise: Link to backporting PR
  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • My changes do not require diagnostic events changes
    • Otherwise: I have added/updated all related diagnostic events and their documentation (Documentation issue linked to PR)
  • I have added all required tests (Unit tests, E2E tests)

Additional information

Additional PR information

@castrodd castrodd requested a review from a team as a code owner June 18, 2025 20:28
@castrodd castrodd changed the title Fix bug in New-PrivateSiteExtension.ps1 Use -or operator in New-PrivateSiteExtension.ps1 Jun 18, 2025
Copy link
Contributor

@jviau jviau left a comment

Choose a reason for hiding this comment

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

Interesting - are you running this with an old powershell version?

@castrodd
Copy link
Member Author

Interesting - are you running this with an old powershell version?

I would need to check what the pipeline is running, but locally I am on 7.5.1.

@Francisco-Gamino Francisco-Gamino self-requested a review June 18, 2025 20:46
@castrodd castrodd merged commit d2238c7 into dev Jun 18, 2025
9 checks passed
@castrodd castrodd deleted the private-site-extension-logic branch June 18, 2025 20:55
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.

3 participants