How Can I Fix My Corrupted PowerShell?

0
13
Asked By TechSavvy4321 On

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?

3 Answers

Answered By CleverCoder77 On

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.

Answered By DevDude101 On

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`.

Answered By FixItFridays99 On

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`.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.