macospowershellopensslwsman

Error "no supported WSMan client library was found." with macOS pwsh


From macOS Terminal, when I execute:

pwsh -command "Enter-PSSession myhost"

I get error from PowerShell:

Enter-PSSession: This parameter set requires WSMan, and no supported WSMan client
library was found. WSMan is either not installed or unavailable for this system.

I've spent 2 hours to find a solution. I am going to answer my own question.


Solution

  • Here's what I did:

    pwsh -Command 'Install-Module -Name PSWSMan'
    sudo pwsh -Command 'Install-WSMan'