Skip to content

Fix PowerShell 5.1 parse failure in HTML report generation#10

Merged
Pnwcomputers merged 1 commit intoVersion5.1from
codex/fix-deployment-errors-for-version-5.1
Mar 25, 2026
Merged

Fix PowerShell 5.1 parse failure in HTML report generation#10
Pnwcomputers merged 1 commit intoVersion5.1from
codex/fix-deployment-errors-for-version-5.1

Conversation

@Pnwcomputers
Copy link
Copy Markdown
Owner

Motivation

  • Replace a switch -Regex expression in Export-HtmlReport with explicit if/elseif checks to avoid a parser error (Unexpected token '{') on Windows PowerShell 5.1 while preserving existing OS edition mappings.

Description

  • Rewrote the inline switch -Regex that derived $osEdition into a simple assignment $osEditionRaw followed by if/elseif matches for Home, Pro, Enterprise, Education, and Server, then pass the result through ConvertTo-HtmlSafe in DeployWorkstation.ps1.

Testing

  • Executed the automated patch script (python) which reported patched, and verified the updated lines in DeployWorkstation.ps1 using nl/sed to confirm the new if/elseif block; running Windows PowerShell 5.1 was not possible in this environment.

Codex Task

@Pnwcomputers Pnwcomputers merged commit b5328c0 into Version5.1 Mar 25, 2026
@Pnwcomputers Pnwcomputers deleted the codex/fix-deployment-errors-for-version-5.1 branch March 25, 2026 20:19
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant