Skip to content

Replace Dism commands with Repair-WindowsImage#325

Open
Karl-WE wants to merge 1 commit into
Azure:mainfrom
Karl-WE:patch-1
Open

Replace Dism commands with Repair-WindowsImage#325
Karl-WE wants to merge 1 commit into
Azure:mainfrom
Karl-WE:patch-1

Conversation

@Karl-WE

@Karl-WE Karl-WE commented Jul 7, 2026

Copy link
Copy Markdown

Replacing all cmdline dism commands with PowerShell dism module, which comes integrated into the OS works with PS5.1 and 7.x likewise.

Staying in PowerShell syntax is cleaner and more efficient as there as less characters to type and it offers autocompletion. Output / Progress / eventually piping.

Replacing all cmdline dism commands with PowerShell dism module, which comes integrated into the OS works with PS5.1 and 7.x likewise. 

Staying in PowerShell syntax is cleaner and more efficient as there as less characters to type and it offers autocompletion.
Output / Progress / eventually piping.
Copilot AI review requested due to automatic review settings July 7, 2026 19:42

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.

Pull request overview

This PR replaces command-line Dism.exe invocations with the DISM PowerShell module's Repair-WindowsImage cmdlet in the "System Drive Free Space" troubleshooting guide, with the stated goal of staying in PowerShell syntax that works on both PS 5.1 and 7.x. While the intent (a consistent PowerShell experience) is reasonable, the specific cmdlet parameters chosen do not map to the original DISM operations, which breaks the documented commands.

Changes:

  • Replaced /AnalyzeComponentStore with Repair-WindowsImage -Online -ScanHealth (different operation).
  • Replaced two /StartComponentCleanup calls with Repair-WindowsImage -Online -StartComponentCleanup (unsupported parameter).
  • Left the surrounding exit-code reporting logic ($LASTEXITCODE) unchanged, which no longer applies to cmdlet output.


# How much the Windows component store (WinSxS) can reclaim
Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore
Repair-WindowsImage -Online -ScanHealth

@Karl-WE Karl-WE Jul 7, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I am a bit baffled that this is the second command, found missing in dism module now. The other one is a specific compression methods for exporting images (Export-WindowsImage). 🤔

Asking internally on DL.

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.

2 participants