Windows PowerShell close as soon as it opens

Discussion in 'other software & services' started by Phil459, Oct 3, 2023.

  1. Phil459

    Phil459 Registered Member

    Joined:
    Aug 4, 2021
    Posts:
    139
    Location:
    USA
    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?
     
  2. busy

    busy Registered Member

    Joined:
    Apr 10, 2006
    Posts:
    507
    See what error it gives by running it in cmd.exe.
     
  3. Brummelchen

    Brummelchen Registered Member

    Joined:
    Jan 3, 2009
    Posts:
    6,298
    see %LOCALAPPDATA%\CrashDumps for dumps and analyze it with WinDBG.
     
  4. xxJackxx

    xxJackxx Registered Member

    Joined:
    Oct 23, 2008
    Posts:
    9,147
    Location:
    USA
  5. Phil459

    Phil459 Registered Member

    Joined:
    Aug 4, 2021
    Posts:
    139
    Location:
    USA
    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."
     
  6. xxJackxx

    xxJackxx Registered Member

    Joined:
    Oct 23, 2008
    Posts:
    9,147
    Location:
    USA
  7. Phil459

    Phil459 Registered Member

    Joined:
    Aug 4, 2021
    Posts:
    139
    Location:
    USA
    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?
     
  8. Phil459

    Phil459 Registered Member

    Joined:
    Aug 4, 2021
    Posts:
    139
    Location:
    USA
    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.
     
  9. xxJackxx

    xxJackxx Registered Member

    Joined:
    Oct 23, 2008
    Posts:
    9,147
    Location:
    USA
    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.
     
  10. Phil459

    Phil459 Registered Member

    Joined:
    Aug 4, 2021
    Posts:
    139
    Location:
    USA
    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.
     
  11. Brummelchen

    Brummelchen Registered Member

    Joined:
    Jan 3, 2009
    Posts:
    6,298
    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.
     
  12. Phil459

    Phil459 Registered Member

    Joined:
    Aug 4, 2021
    Posts:
    139
    Location:
    USA
    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! :thumb:
     
  13. xxJackxx

    xxJackxx Registered Member

    Joined:
    Oct 23, 2008
    Posts:
    9,147
    Location:
    USA
    It's getting to be one of the few options left. I have been reading that they are going to deprecate VBScript altogether.
     
  14. Brummelchen

    Brummelchen Registered Member

    Joined:
    Jan 3, 2009
    Posts:
    6,298
    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.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.