How Can I Fix My Corrupted PowerShell?

July 8, 2025 3 answers
Asked by 0p5mm-pass
I've been having issues with my PowerShell, and it seems like it's corrupted. I've already tried running the `sfc /scannow` command, which indicated that Windows Resource Protection found corrupt files but couldn't fix them. The CBS log file provides more details, and I discovered that both `powershell.exe` and `curl.exe` have errors saying their files cannot be checked, indicating possible corruption. I attempted to repair it using an official ISO with the command `DISM /Online /Cleanup-Image /RestoreHealth /Source:D:sourcesinstall.wim /LimitAccess`, but unfortunately, PowerShell is still corrupted. Can anyone suggest additional steps to resolve this?

Answers

vowel+shift
You can try using DISM again to repair the corrupted files. Make sure to run this command: `DISM /Online /Cleanup-Image /RestoreHealth`. If that doesnโ€™t solve the issue, consider downloading the latest Windows ISO and extracting the WIM file. Then, use DISM to copy back the PowerShell files. You would do that with the command: `dism /Mount-Image /ImageFile:"C:install.wim" /Index:6 /MountDir:C:Mount` and then use `robocopy "C:MountWindowsSystem32WindowsPowerShellv1.0" "C:WindowsSystem32WindowsPowerShellv1.0" /E /COPYALL /R:0`.
Reply to this answer
flour+water
Just a heads up, if your system volume is failing, that might lead to similar corruption issues. Make sure your drive is in good health before proceeding with repairs. And regarding `curl`, it's actually just a placeholder that Microsoft uses as an alias for `Invoke-WebRequest`, but it might not function completely like the original `curl`.
Reply to this answer
!plot2axes
Instead of just copying files, which might be causing the issue, you could try a different approach since PowerShell is optional in Windows. Run `optionalfeatures.exe`, and deselect PowerShell. Wait for it to finish, reboot if prompted, and then go back and select PowerShell to reinstall it. This might help reset any issues youโ€™re facing. Also, consider reinstalling the latest cumulative update for your system in case that's part of the problem.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions