Skip to content

FixUserFilePermissions.ps1: use wildcard to get keys#864

Open
sharpchen wants to merge 2 commits into
PowerShell:latestw_allfrom
sharpchen:glob-keys
Open

FixUserFilePermissions.ps1: use wildcard to get keys#864
sharpchen wants to merge 2 commits into
PowerShell:latestw_allfrom
sharpchen:glob-keys

Conversation

@sharpchen

Copy link
Copy Markdown

PR Summary

Use wildcard pattern for -Include

PR Context

ssh keys can have arbitrary names, using algorithm name as prefix should be a common and good practice.
Currently it only matches on exact name, use wildcard to include those with prefixes.

Copilot AI review requested due to automatic review settings July 14, 2026 19:24
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the Windows FixUserFilePermissions.ps1 helper to discover user SSH keys with algorithm-prefixed variants (e.g., id_ed25519_sk*) by expanding the Get-ChildItem -Include patterns.

Changes:

  • Switch key discovery from exact filenames (id_rsa, id_ed25519, …) to wildcard patterns (id_rsa*, id_ed25519*, …) to cover algorithm-prefixed variants.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread contrib/win32/openssh/FixUserFilePermissions.ps1 Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 1 comment.

Comment on lines +13 to +15
Get-ChildItem ~\.ssh\* -File -Include "id_rsa*","id_dsa*","id_ecdsa*","id_ed25519*" -ErrorAction SilentlyContinue |
Where-Object Extension -eq '' |
ForEach-Object {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Might have *.bak as well, would you like to include them?

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