Skip to content

Conversation

@benhillis
Copy link
Member

This change does two things:

  1. Rewrote the certificate import logic to try -AllowUnsigned first, avoiding PowerShell module conflicts that were causing installation failures.
  2. Changed Get-AppPackageLog -All to only show the last 10 entries from the past 5 minutes, making errors visible. Previously the entire log was flooding the output.

Copy link
Contributor

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 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 -AllowUnsigned parameter 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

Copy link
Collaborator

@OneBlue OneBlue left a 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 ?

@benhillis benhillis closed this Dec 5, 2025
@benhillis benhillis reopened this Dec 6, 2025
@benhillis
Copy link
Member Author

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.

Copy link
Contributor

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

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

Copy link
Contributor

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

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

Comment on lines 107 to 109
if (-not $installed) {
Add-AppxPackage $Package -ErrorAction Stop
}
Copy link

Copilot AI Dec 8, 2025

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.

Copilot uses AI. Check for mistakes.
…g it from being run from some version of powershell
Copy link
Contributor

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@benhillis benhillis merged commit 7f84226 into master Dec 12, 2025
12 checks passed
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