-
Notifications
You must be signed in to change notification settings - Fork 1.6k
test: fix and issue with the test-setup.ps1 script that was preventing it from being run from some version of powershell #13834
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
Conversation
There was a problem hiding this 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 compatibility issues in the test-setup.ps1 script to enable it to run across different PowerShell versions. The changes address two main problems: PowerShell module conflicts during certificate import and overwhelming log output when errors occur.
- Rewrote certificate import logic to try
-AllowUnsignedparameter first before falling back to manual certificate import - Replaced unlimited log output with filtered output showing only the last 10 entries from the past 5 minutes
- Improved error messages and added proper error handling for certificate operations
OneBlue
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, what's the context on the module conflict ?
I've had issues running the test script from the powershell prompt in vscode. This made the issue go away. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 5 comments.
tools/test/test-setup.ps1
Outdated
| if (-not $installed) { | ||
| Add-AppxPackage $Package -ErrorAction Stop | ||
| } |
Copilot
AI
Dec 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the certificate is imported in the catch block (lines 82-103), the code falls through to line 107 and attempts package installation again. However, this second installation attempt (line 108) doesn't include the -AllowUnsigned flag, which may still be needed even after importing the certificate. Consider adding the certificate import retry logic inside the inner try block to ensure it retries with -AllowUnsigned if that was the original intent, or verify that certificate import alone is sufficient without the flag.
…g it from being run from some version of powershell
537d8c8 to
85f51d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
This change does two things: