Every once in a while I mess up my Windows installation… you know, things stop working and stuff giving errors all over the place.
Due to some projects I’m working on the last few months the Microsoft.PowerShell plugin gets corrupted corrupted frequently (don’t ask my what I’m doing to accomplish that ).
Specifically, when trying to open a remote session, or simply when I do a “Invoke-Command” to the localhost, an error is given stating that it cannot find the Microsoft.PowerShell session configuration in WSMAN.
So, how can you quickly fix that and more importantly, howto do it the easy way.
winrm invoke Restore http://schemas.microsoft.com/wbem/wsman/1/config/plugin @{}
This will restore the default plugin configuration… and yes, you’ll need an internet connection for this to work
Note: I’m assuming here that you’ve checked if WinRM is configured properly. The solution in this post is a last resort and should not be applied when other options (like Enable-PSRemoting -Force) are available.
Big fat note: All external plugins will be unregistered by this command!