Skip to content

Conversation

VeryEarly
Copy link
Collaborator

Description

image
image

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 Copilot AI review requested due to automatic review settings June 30, 2025 05:01
Copy link

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

Copy link
Contributor

@Copilot 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 fixes the regex pattern used for matching Autorest-related module directories.

  • Corrects variable interpolation in the regex pattern for submodule name matching.

$moduleRootPath = Join-Path $SourceDirectory $ModuleRootName
$subModuleNameTrimmed = $SubModuleName
$subModuleName = Get-ChildItem -Path $moduleRootPath -Directory | Where-Object { $_.Name -match '$(subModuleNameTrimmed)\.' } | ForEach-Object { $_.Name }
$subModuleName = Get-ChildItem -Path $moduleRootPath -Directory | Where-Object { $_.Name -match '${subModuleNameTrimmed}\.' } | ForEach-Object { $_.Name }
Copy link

Copilot AI Jun 30, 2025

Choose a reason for hiding this comment

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

The updated regex pattern is still enclosed in single quotes, which prevents variable interpolation. Consider using double quotes to enable variable expansion, e.g., -match "${subModuleNameTrimmed}.".

Suggested change
$subModuleName = Get-ChildItem -Path $moduleRootPath -Directory | Where-Object { $_.Name -match '${subModuleNameTrimmed}\.' } | ForEach-Object { $_.Name }
$subModuleName = Get-ChildItem -Path $moduleRootPath -Directory | Where-Object { $_.Name -match "${subModuleNameTrimmed}\." } | ForEach-Object { $_.Name }

Copilot uses AI. Check for mistakes.

@isra-fel
Copy link
Member

image

The issue was with the single quotes - expressions are evaluated only in double quotes

@YanaXu YanaXu merged commit 4540d40 into main Jun 30, 2025
12 checks passed
@YanaXu YanaXu deleted the VeryEarly-patch-3 branch June 30, 2025 06:09
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