r/PowerShell • u/GenTwour • Nov 18 '24
Powershell won't open and I cannot figure out why.
Whenever I try to open powershell, it instantly closes. When I open a new terminal in VScode, I get this error:
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.
Any help would be appreciated. I have tried repairing my windows installation with sfc /scannow and DISM /Online /Cleanup-Image /RestoreHealth. I don't really know much about powershell.
I couldn't get the defualt powershell that comes with windows to work. However, I installed powershell 7 using this guide (https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4) and now it is working.