Jean-Pierre Matsumoto
Jean-Pierre Matsumoto

Reputation: 2325

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.

Upvotes: 28

Views: 60453

Answers (4)

Ed Campbell
Ed Campbell

Reputation: 91

This followings work on Mac without issue.

pwsh -Command 'Install-Module -Name PSWSMan'

sudo pwsh -Command 'Install-WSMan'

Upvotes: 9

Simon
Simon

Reputation: 374

See from Matt Thornton: Exchange Online Powershell on macOS

Tested below on MacOS 11.6

  1. brew install powershell
  2. brew install openssl
  3. pwsh
  4. Install-Module -Name PowerShellGet
  5. Install-Module -Name PSWSMan
  6. sudo pwsh -Command 'Install-WSMan'

Upvotes: 17

0x3333
0x3333

Reputation: 674

Here's what I did:

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

Upvotes: 43

Jean-Pierre Matsumoto
Jean-Pierre Matsumoto

Reputation: 2325

Root cause of the issue is Powershell dependency to previous openssl version. It is apparently not easy to fix according to GitHub issue PowerShell/#5561.

Here is the workaround I have found:

curl -L https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb \
  -o openssl.rb
brew install ./openssl.rb

Upvotes: 4

Related Questions