Skip to content
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

Remove use of Invoke-Expression in test script #2921

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

florelis
Copy link
Member

@florelis florelis commented Feb 3, 2023

We have a test script that uses Invoke-Expression to execute a command from a string we make up with string concatenation. This isn't good because the string gets parsed as Powershell code and it's easy to get it to inject other commands on it. This change replaces the use of Invoke-Expression by the use of the call operator & and passing the arguments as an array of strings, instead of a single string to be parsed. This script is only used on an internal pipeline where we supply all the input.

Microsoft Reviewers: Open in CodeFlow

@florelis florelis requested a review from a team as a code owner February 3, 2023 22:57
@florelis florelis merged commit 27a055e into microsoft:master Feb 3, 2023
@florelis florelis deleted the script branch February 3, 2023 23:12
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.

2 participants