Fix PowerShell script inconsistencies and documentation errors#3015
Fix PowerShell script inconsistencies and documentation errors#3015Copilot wants to merge 3 commits into
Conversation
|
@copilot please apply the required changes |
Co-authored-by: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com>
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 All scripts pass syntax validation and help documentation displays properly. The changes are ready for review. |
DRSDavidSoft
left a comment
There was a problem hiding this comment.
Approved after refreshing the PR branch to keep the PowerShell common parameter examples/comments consistently cased as -Verbose. I also applied the compatible cleanup to \development\ separately because the original PR diff conflicts with the newer development packaging/profile changes.
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.ps1script contained multiple references tobuild.ps1in its help documentation:UnblockFile .\build.ps1→UnblockFile .\update.ps1.\build.ps1and.\build -verbose→.\update.ps1and.\update.ps1 -verbose2. Inconsistent Project URL References
Scripts were using different URLs in their help documentation:
pack.ps1used:https://github.com/cmderdev/cmderbuild.ps1andupdate.ps1used:http://cmder.app/All scripts now consistently reference the GitHub project URL.
3. Variable Naming Inconsistencies
The codebase had mixed usage of
$cmder_rootvs$cmderRoot. Standardized on$cmder_root(underscore notation) for consistency across all scripts while preserving the$cmderRootparameter inpack.ps1for backward compatibility.4. Error Handling Pattern Inconsistencies
Some utility functions used
Write-Errorfollowed byexit 1while others usedthrowstatements. Updated theEnsure-ExistsandEnsure-Executablefunctions to usethrowfor consistency with PowerShell best practices and the rest of the codebase.5. Additional Documentation Fix
Fixed an inconsistent example in
build.ps1that showed.\build -verboseinstead 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.