Skip to content

Conversation

vidai-msft
Copy link
Contributor

Description

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 September 4, 2025 08:40
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 refactors PowerShell script code to replace the use of Invoke-Expression with the call operator (&) for executing commands and functions. This change improves security by avoiding string-based command execution and follows PowerShell best practices.

Key Changes

  • Replace Invoke-Expression calls with the safer call operator (&)
  • Clean up code formatting by removing unnecessary line breaks and standardizing brace placement
  • Remove semicolons at end of statements following PowerShell conventions

Reviewed Changes

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

Show a summary per file
File Description
tools/Test/SmokeTest/RmCoreSmokeTests.ps1 Updated command execution in retry function and replaced string concatenation approach with direct call operator usage
src/Resources/Resources.Test/ScenarioTests/RoleDefinitionTests.ps1 Replaced Invoke-Expression with call operator and cleaned up function formatting
src/KeyVault/KeyVault.Test/Scripts/VaultManagedStorageAccountTests.ps1 Updated multiple test functions to use call operator instead of Invoke-Expression
src/Compute/Compute.Test/ScenarioTests/VMDynamicTests.ps1 Replaced Invoke-Expression with call operator for function invocation and updated code formatting
src/Compute/Compute.Test/ScenarioTests/ComputeTestCommon.ps1 Updated command execution pattern and cleaned up function formatting throughout

@vidai-msft vidai-msft marked this pull request as draft September 4, 2025 09:01
@vidai-msft
Copy link
Contributor Author

/azp run

Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@vidai-msft vidai-msft marked this pull request as ready for review September 5, 2025 06:32
@VeryEarly VeryEarly self-assigned this Sep 5, 2025
@vidai-msft
Copy link
Contributor Author

/azp run

Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@vidai-msft
Copy link
Contributor Author

/azp run

Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@isra-fel
Copy link
Member

isra-fel commented Sep 9, 2025

/azp run azure-powershell - powershell-core

@isra-fel
Copy link
Member

isra-fel commented Sep 9, 2025

/azp run azure-powershell - powershell-core

Copy link
Contributor

No pipelines are associated with this pull request.

Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@vidai-msft vidai-msft closed this Sep 9, 2025
@vidai-msft vidai-msft reopened this Sep 9, 2025
@vidai-msft vidai-msft merged commit 7450b93 into main Sep 9, 2025
12 checks passed
@vidai-msft vidai-msft deleted the vidai/testfx-sec branch September 9, 2025 12:23
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