Reputation: 2325
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
Reputation: 91
This followings work on Mac without issue.
pwsh -Command 'Install-Module -Name PSWSMan'
sudo pwsh -Command 'Install-WSMan'
Upvotes: 9
Reputation: 374
See from Matt Thornton: Exchange Online Powershell on macOS
Tested below on MacOS 11.6
brew install powershell
brew install openssl
pwsh
Install-Module -Name PowerShellGet
Install-Module -Name PSWSMan
sudo pwsh -Command 'Install-WSMan'
Upvotes: 17
Reputation: 674
Here's what I did:
pwsh -Command 'Install-Module -Name PSWSMan'
sudo pwsh -Command 'Install-WSMan'
Upvotes: 43
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