Skip to content

Stop deployment when setup scripts cannot be written - #42

Merged
OSDeploy merged 2 commits into
mainfrom
copilot/fix-comments-in-review-thread
Oct 6, 2026
Merged

OSDeploy merged 2 commits into
mainfrom
copilot/fix-comments-in-review-thread

Conversation

Copilot AI commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Setup script creation or writes could fail non-terminatingly, allowing deployment to continue without complete setup. Make these operations terminating so failures reach the existing handler.

  • Setup operations: Add -ErrorAction Stop to setup directory/file creation and both script writes.
  • Coverage: Add a Pester test asserting each operation uses terminating error handling.
New-Item -Path 'C:\Windows\Setup\Scripts' -ItemType Directory -Force -ErrorAction Stop

Co-authored-by: OSDeploy <12970006+OSDeploy@users.noreply.github.com>
@OSDeploy
OSDeploy marked this pull request as ready for review October 6, 2026 13:05
@OSDeploy
OSDeploy self-requested a review as a code owner October 6, 2026 13:05
Copilot AI balanced review requested due to automatic review settings October 6, 2026 13:05
@OSDeploy
OSDeploy merged commit 9d6153c into main Oct 6, 2026
@OSDeploy
OSDeploy deleted the copilot/fix-comments-in-review-thread branch October 6, 2026 13:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The expanded failure handler now emits a misleading image-expansion warning for setup-script failures, and planned validation remains incomplete.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Makes setup-directory and script-write failures terminate within the existing installation failure handler.

Changes:

  • Adds -ErrorAction Stop to setup directory/file creation.
  • Makes SetupComplete.cmd and OOBE.cmd writes terminating.
File Description
OSDCloud/​private/​steps/​4-install/​step-install-expandwindowsimage.ps1 Routes setup initialization failures through the existing catch block.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

":: RecastOSDCloud $(Get-Date -format s)" | Out-File -FilePath 'C:\Windows\Setup\Scripts\OOBE.cmd' -Append -Encoding ascii -Width 2000 -Force -ErrorAction Stop
}
catch {
Write-Warning "[$(Get-Date -format s)] Expand-WindowsImage failed."
Copilot AI changed the title [WIP] Fix code based on review comments Stop deployment when setup scripts cannot be written Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants