Fix PowerShell 5.1 parse failure in HTML report generation#10
Merged
Pnwcomputers merged 1 commit intoVersion5.1from Mar 25, 2026
Merged
Conversation
Pnwcomputers
added a commit
that referenced
this pull request
Apr 1, 2026
* Update DeployWorkstation.ps1 to version 4.0 (#8) * Update DeployWorkstation.bat for version 4.0 * Fix syntax error in DeployWorkstation.ps1 * Revise roadmap for upcoming versions and features Updated roadmap to reflect new versioning and features. * Update DeployWorkstation.ps1 * Fix roadmap entry for Configuration Management Integration * Update future enhancements in README Removed 'Real-time Progress' and 'Multi-language Support' from future enhancements. * Delete CONTRIBUTING.md * Rename CHANGELOG.md to .github/CHANGELOG.md * Rename generate_changelog.py to Logs/generate_changelog.py * Rename FAQ.md to docs/FAQ.md * Delete .gitignore * Update print statement from 'Hello' to 'Goodbye' * Refactor logging messages for winget management * Improve language resolution and HTML output formatting Refactor language resolution logic and update OS info display. * Fix exit command in DeployWorkstation.bat * Update README title to Version5 * Add roadmap item for improved app removal and installation * Fix version heading typo in README.md * Update README with new features for version 5 Added new features and roadmap for version 5. * Revise 'What's New' section in README Updated the 'What's New' section for Version 5. * Update security contact email in README * Refactor path handling for script root and logging * Fix formatting of invalid choice message in batch file * Update version from 4.0 to 6.0 in batch file * Add newline at end of DeployWorkstation.ps1 Fix missing newline at the end of the file. * Fix duration calculation to use Floor method * Update version number in DeployWorkstation.bat * Update version number from 6.0 to 5.0 * Update DeployWorkstation Launcher version to v5.0 * Update version number from 6.0 to 5.0 * Update DeployWorkstation script to version 5.1 * Update version from 5.0 to 5.1 in DeployWorkstation.bat * Fix exit command formatting in DeployWorkstation.bat * Fix network error codes and improve logging * Update README version from 5 to 5.1 * Fix exit command in DeployWorkstation.bat * Fix exit command in DeployWorkstation.bat * Fix exit command formatting in DeployWorkstation.bat * Update DeployWorkstation.bat (#9) * Change default case output to 'Unknown' * Fix exit command formatting in DeployWorkstation.bat * Add newline at end of DeployWorkstation.ps1 Fix missing newline at end of file. * Replace 'Hello World' with 'Goodbye World' * Delete DeployWorkstation.bat * Rename DeployWorkstaton.bat to DeployWorkstation.bat * Add newline at end of DeployWorkstation.ps1 Fix missing newline at end of file. * Update print statement from 'Hello' to 'Goodbye' * Add newline at end of DeployWorkstation.ps1 Fix missing newline at end of file. * Fix OS edition detection parse error in PS5.1 report (#10) * Add cmd compatibility launcher and harden validation tests (#11) * Delete DeployWorkstation.cmd * Upgrade DeployWorkstation.bat to version 5.2 Updated the DeployWorkstation.bat script to version 5.2, enhancing error handling and ensuring proper execution of the PowerShell script. * Update print statement from 'Hello' to 'Goodbye' * Update launcher version from v5.2 to v5.1 * Upgrade DeployWorkstation Launcher to v6.0 Updated launcher version and improved error messages. * Change 'Hello World' to 'Goodbye World' * Change launcher version and enhance error messages Updated the launcher version from 6.0 to 5.1 and improved error handling messages. * Update fmt.Println message from 'Hello' to 'Goodbye' * Update print statement from 'Hello' to 'Goodbye' * Refactor DeployWorkstation.bat for better execution flow Updated the script to improve error handling and parameter passing. * Fix exit command in DeployWorkstation.bat * Add newline at end of DeployWorkstation.ps1 Fix missing newline at end of DeployWorkstation.ps1 * Update version comment in DeployWorkstation.bat * Update version comment in DeployWorkstation.ps1 * Optimize osEdition assignment and remove update date Removed unnecessary line about update date and optimized the osEdition assignment. * Update version comment in DeployWorkstation.bat * Handle Winget exit codes for uninstall operations * Refactor error handling in DeployWorkstation.ps1 * Enhance error handling and logging in DeployWorkstation Added a new known failure code for missing packages in winget source and adjusted logging for cleaner output. * Fix syntax for known failure messages in DeployWorkstation.ps1 * Refactor error handling for installation failures * Implement script integrity verification Added integrity verification for DeployWorkstation.ps1. * Refactor comments and improve script readability * Update version to 5.1.4.1.2026 in DeployWorkstation.ps1 * Refactor DeployWorkstation.bat for clarity and updates * Update version comment in DeployWorkstation.bat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
switch -Regexexpression inExport-HtmlReportwith explicitif/elseifchecks to avoid a parser error (Unexpected token '{') on Windows PowerShell 5.1 while preserving existing OS edition mappings.Description
switch -Regexthat derived$osEditioninto a simple assignment$osEditionRawfollowed byif/elseifmatches forHome,Pro,Enterprise,Education, andServer, then pass the result throughConvertTo-HtmlSafeinDeployWorkstation.ps1.Testing
python) which reportedpatched, and verified the updated lines inDeployWorkstation.ps1usingnl/sedto confirm the newif/elseifblock; running Windows PowerShell 5.1 was not possible in this environment.Codex Task