Skip to content

Improve user validation#568

Merged
Raphire merged 6 commits into
masterfrom
improve-user-validation
May 6, 2026
Merged

Improve user validation#568
Raphire merged 6 commits into
masterfrom
improve-user-validation

Conversation

@Raphire
Copy link
Copy Markdown
Owner

@Raphire Raphire commented Apr 29, 2026

This addresses #567, improves user validation by hardening the user profile folder check and properly checking account existence

Co-authored-by: Copilot <[email protected]>
Copy link
Copy Markdown

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

Improves “Other User” validation (Issue #567) by hardening username input checks and ensuring the entered user corresponds to a real Windows account/profile before allowing “target user” operations.

Changes:

  • Adds stricter username sanitization (trim, invalid filename characters, bracket handling).
  • Expands profile directory detection to support non-standard Users roots.
  • Adds an account existence check via CIM (Win32_UserAccount) with a Get-LocalUser fallback.

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

Comment thread Scripts/Helpers/CheckIfUserExists.ps1
Comment thread Scripts/Helpers/CheckIfUserExists.ps1 Outdated
Comment thread Scripts/Helpers/CheckIfUserExists.ps1 Outdated
Copy link
Copy Markdown

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 4 out of 4 changed files in this pull request and generated 4 comments.


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

Comment thread Scripts/Helpers/CheckIfUserExists.ps1 Outdated
Comment thread Scripts/Helpers/CheckIfUserExists.ps1 Outdated
Comment thread Scripts/Helpers/ResolveUserProfilePath.ps1 Outdated
Comment thread Scripts/Helpers/ResolveUserProfilePath.ps1
Copy link
Copy Markdown

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 4 out of 4 changed files in this pull request and generated 2 comments.


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

Comment thread Scripts/Helpers/GetUserDirectory.ps1
Comment thread Scripts/Helpers/CheckIfUserExists.ps1 Outdated
Copy link
Copy Markdown

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 4 out of 4 changed files in this pull request and generated 3 comments.


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

Comment thread Scripts/Helpers/ResolveUserProfilePath.ps1 Outdated
Comment thread Scripts/Helpers/ResolveUserProfilePath.ps1 Outdated
Comment thread Scripts/Helpers/CheckIfUserExists.ps1 Outdated
…context for improved validation

Co-authored-by: Copilot <[email protected]>
Copy link
Copy Markdown

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 4 out of 4 changed files in this pull request and generated 5 comments.


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

Comment thread Scripts/Helpers/CheckIfUserExists.ps1
Comment thread Scripts/Helpers/GetUserDirectory.ps1
Comment thread Scripts/Helpers/GetUserDirectory.ps1
Comment thread Scripts/Helpers/GetUserDirectory.ps1
Comment thread Scripts/Helpers/GetUserDirectory.ps1
Copy link
Copy Markdown

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 4 out of 4 changed files in this pull request and generated 2 comments.


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

Comment thread Scripts/Helpers/GetUserDirectory.ps1
Comment thread Scripts/Helpers/ResolveUserProfilePath.ps1
@Raphire Raphire merged commit 11a3243 into master May 6, 2026
4 checks passed
@Raphire Raphire deleted the improve-user-validation branch May 6, 2026 13:54
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