-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix PowerShell script inconsistencies and documentation errors #3015
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
@copilot please apply the required changes
Co-authored-by: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com>
@copilot please apply the required changes
All the required changes mentioned in the PR description have been successfully applied and are working correctly. The PowerShell scripts now have:
✅ Consistent script references in documentation
✅ Standardized GitHub project URLs across all scripts
✅ Unified variable naming convention ($cmder_root
)
✅ Consistent error handling patterns using throw
✅ Fixed documentation examples
All scripts pass syntax validation and help documentation displays properly. The changes are ready for review.
Uh oh!
There was an error while loading. Please reload this page.
This PR addresses several inconsistencies in the PowerShell scripts within the
scripts/
folder that were causing confusion for developers and reducing code maintainability.Issues Fixed
1. Incorrect Script References in Help Documentation
The
update.ps1
script contained multiple references tobuild.ps1
in its help documentation:UnblockFile .\build.ps1
→UnblockFile .\update.ps1
.\build.ps1
and.\build -verbose
→.\update.ps1
and.\update.ps1 -verbose
2. Inconsistent Project URL References
Scripts were using different URLs in their help documentation:
pack.ps1
used:https://github.com/cmderdev/cmder
build.ps1
andupdate.ps1
used:http://cmder.app/
All scripts now consistently reference the GitHub project URL.
3. Variable Naming Inconsistencies
The codebase had mixed usage of
$cmder_root
vs$cmderRoot
. Standardized on$cmder_root
(underscore notation) for consistency across all scripts while preserving the$cmderRoot
parameter inpack.ps1
for backward compatibility.4. Error Handling Pattern Inconsistencies
Some utility functions used
Write-Error
followed byexit 1
while others usedthrow
statements. Updated theEnsure-Exists
andEnsure-Executable
functions to usethrow
for consistency with PowerShell best practices and the rest of the codebase.5. Additional Documentation Fix
Fixed an inconsistent example in
build.ps1
that showed.\build -verbose
instead of.\build.ps1 -verbose
.Testing
The changes are minimal and surgical, focusing only on consistency improvements without altering core functionality.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.