Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 682
Jean-Pierre Matsumoto Avatar asked Jan 20 '21 10:01

Jean-Pierre Matsumoto


3 Answers

Here's what I did:

pwsh -Command 'Install-Module -Name PSWSMan'
sudo pwsh -Command 'Install-WSMan'
like image 154
0x3333 Avatar answered Oct 31 '22 23:10

0x3333


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'
like image 12
Simon Avatar answered Nov 01 '22 00:11

Simon


This followings work on Mac without issue.

pwsh -Command 'Install-Module -Name PSWSMan'

sudo pwsh -Command 'Install-WSMan'
like image 7
Ed Campbell Avatar answered Oct 31 '22 23:10

Ed Campbell