Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Aug 12, 2025

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 to build.ps1 in its help documentation:

  • UnblockFile .\build.ps1UnblockFile .\update.ps1
  • Example commands showing .\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 and update.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 in pack.ps1 for backward compatibility.

4. Error Handling Pattern Inconsistencies

Some utility functions used Write-Error followed by exit 1 while others used throw statements. Updated the Ensure-Exists and Ensure-Executable functions to use throw 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

  • ✅ All PowerShell scripts pass syntax validation
  • ✅ Help documentation displays correctly for all scripts
  • ✅ Scripts load without errors
  • ✅ No breaking changes to existing functionality

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.

@DRSDavidSoft
Copy link
Contributor

@copilot please apply the required changes

@Copilot Copilot AI changed the title [WIP] Fix PowerShell script inconsistencies and documentation errors Fix PowerShell script inconsistencies and documentation errors Aug 12, 2025
@Copilot Copilot AI requested a review from DRSDavidSoft August 12, 2025 03:03
Copilot finished work on behalf of DRSDavidSoft August 12, 2025 03:03
Copy link
Author

Copilot AI commented Aug 12, 2025

@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.

Copilot finished work on behalf of DRSDavidSoft August 12, 2025 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants