3

Whenever I try to open Powershell, it just won't open. When I try to open it from the cmd, I get this error:

The shell cannot be started. A failure occurred during initialization: The type initializer for 'System.Net.ServicePointManager' threw an exception.

Things I have tried:

  • opening with administrator
  • sfc /scannow which showed no errors

The 32 bit version of powershell still works for some reason if that helps in any way.

  • @PimpJuiceIT Thank you for the assistance, I followed your steps but the same error occurs. – gommb Jan 31 '19 at 6:24
  • @PimpJuiceIT I tried everything you said and nothing worked. The only thing I couldn't do is look through Event Viewer because when I open it up I get this error MMC cannot initialize the snap-in. I wonder if this could be in any way related to the powershell error. – gommb Feb 1 '19 at 20:49
  • @PimpJuiceIT I use Norton – gommb Feb 1 '19 at 21:51
  • @PimpJuiceIT After almost a month of searching, I narrowed this down to the Microsoft.NET folder in C:\Windows. I replaced this folder with a friend's Microsoft.NET folder who wasn't having the issue, and powershell suddenly works again. – gommb Feb 21 '19 at 2:59
  • Here's a tool here that may have helped too: microsoft.com/en-us/download/details.aspx?id=30135 – Pimp Juice IT Feb 21 '19 at 13:03
2

I just dealt with this on a client computer. The problem was that the machine.config files for .NET Framework 4.x had both been corrupted (they had somehow become zero-length files).

Deleting the files is insufficient.

It worked to simply replace the zero length files with the code below, but I used the "known good" versions in order to ensure that there weren't any long-term side-effects.

This is the minimum required content for the machine.config files:

<?xml version="1.0" encoding="UTF-8"?>
<configuration />

Replacing these two files with "known good" copies of machine.config from the same version resolved this for me and didn't leave me worrying that some unknown issue would crop up later.

After fixing or replacing the machine.config files a reboot is required.

  • Interesting, and good to know fix!! – Pimp Juice IT Jul 7 '19 at 22:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.