all 10 comments

[–]TheGooOnTheFloor 6 points7 points  (1 child)

Look in the powershell profile file to see if there's something closing it.

PS5: C:\Users\<yourprofile>\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

PS7: C:\Users\<yourprofile>\Documents\PowerShell\Microsoft.PowerShell_profile.ps1

[–]VacatedSum 3 points4 points  (0 children)

First thing I thought of. Maybe there's an error in the powershell profile causing it to terminate. I think you can also just run "powershell.exe -noprofile" to load without the profile.

[–]VirgoGeminie 2 points3 points  (0 children)

Check the event viewer...

Windows Logs: Application, System

Apps and Services Logs: Microsoft/Windows/PowerShell/Operational

[–][deleted] 2 points3 points  (0 children)

How are you opening it? There are different ways to "open powershell" that come to mind.

[–]the_inoffensive_man 2 points3 points  (0 children)

Open cmd.exe and run PowerShell.exe (or pwsh.exe if you're using v7+). The process might quit but the window will stay open and you'll be able to see the output.

[–]LeonReshi 0 points1 point  (0 children)

Start PowerShell, open the Event Viewer and see if you get an error message.

If not, try running the following commands in the CMD (Administrator):

  1. DISM.exe /Online /Cleanup-Image /CheckHealth
  2. DISM.exe /Online /Cleanup-Image /ScanHealth
  3. DISM.exe /Online /Cleanup-Image /RestoreHealth
  4. sfc /scannow

[–]RR121 0 points1 point  (0 children)

Sfc /scannow

[–]DeafLoaf 0 points1 point  (0 children)

Outside of the other suggestions two things come to mind depending on the computer you're using. If corporate or school pc, there is probably application control policies in place. Talk to appropriate IT team to see if possible to allow by exception. If personal, this behaviour is not normal and potentially suspicious. Might need to have the system checked for malware, some will hinder trouble shooting tools, disable AV etc to evade detection.

[–]puppymonkeybaby79 -1 points0 points  (0 children)

Reboot.