Can anyone think of a reason why Windows PowerShell would crash as soon as it's opened? It's the version that came preinstalled with Windows 10. I've tried everything I can think of: I ran DISM and SFC, I tried disabling and enabling PowerShell in "Turn Windows features on and off"; I created a new account. The fact that it still doesn't work in the new account makes me think it must be in the system. It actually hasn't worked for awhile now but I only started getting serious about trying to fix it today. I have Windows 10 Home 19045.3448 22H2. My highest version of .NET is 4.8. As I understand it, PowerShell should work with .NET versions higher than 4.5. I downloaded the PowerShell app from the Microsoft Store and it works okay, but it bugs me that I can't figure out what's wrong with the other one. I don't have any third-party antimalware software installed. Since it opens then closes it might be some other program or process that's interfering with it but I wouldn't even know where to start looking. I did try to run it in safe mode but it still didn't work. Any ideas?
You could check this out also: PowerShell Crashes upon opening - Microsoft Community I know you said you tried DISM but it couldn't hurt to give this example a go. You could also see if there are any entries in your Event Viewer logs.
Hey busy. It says: "Windows PowerShell terminated with the following error: Could not load file or assembly 'System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The module was expected to contain an assembly manifest."
Per this person a Windows reinstall fixed it for them. You could do an over the top install and not lose anything. If it were me I would download the current ISO and give it a shot. Powershell closes immediately. : r/PowerShell (reddit.com)
I looked in C:\Users\MyUserName\AppData\Local for crash dumps but only found three that were modified today and they are associated with Microsoft Edge. Is that the right folder?
Thanks for that idea. If it was crucial I might do that, but at this point it's only a mild irritation. I spent a lot of time today on both Microsoft Community and Reddit. I was hoping for an easy solution. If it gets too complicated I'll probably just forget it.
An over the top reinstall isn't hard. Unfortunately it also isn't fast but most of it is just wait time. Probably an hour or 2 to find the ISO, download it, and perform the install. I've done 2 of them at work recently. Both PCs were fixed of the errors we were getting.
Thanks for the advice folks. I decided to choose the path of least resistance and just use PowerShell 7. I've learned with Microsoft that's usually the best option.
i installed PS7 with the regular update, to see what about benefit. anyhow i dont use PS that much, more the command line although PS can handle batch and more. PS is able to work much more close to windows than batch, eg. remove unwanted apps, creating backups of firefox profiles in a quite decent manner, and much more. no gui, ofc, like real apps.
Windows PowerShell has started working. I think it must have something to do with the PowerShell cross-platform app I installed. It updated once through Windows Update and it must've had something Windows PowerShell needed. Anyway, wanted to report back with the news. I don't use PowerShell that much but it seems like I'm always coming across things that can be done with it that aren't easily done any other way. The PowerShell app is bloatware anyway (350MB); glad to be rid of it!
It's getting to be one of the few options left. I have been reading that they are going to deprecate VBScript altogether.
MS will deprecate VBS for windows (see posting above), current example: "slmgr.vbs" the only solution will be a conversion to PS which is possible. so considering Powershell as a dead end, your fail in total.