23

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.

Jean-Pierre Matsumoto
  • 1,917
  • 1
  • 18
  • 26

4 Answers4

38

Here's what I did:

pwsh -Command 'Install-Module -Name PSWSMan'
sudo pwsh -Command 'Install-WSMan'
0x3333
  • 614
  • 7
  • 11
15

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'
Simon
  • 354
  • 3
  • 10
7

This followings work on Mac without issue.

pwsh -Command 'Install-Module -Name PSWSMan'

sudo pwsh -Command 'Install-WSMan'
benson23
  • 16,369
  • 9
  • 19
  • 38
Ed Campbell
  • 71
  • 1
  • 2
4

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
Jean-Pierre Matsumoto
  • 1,917
  • 1
  • 18
  • 26
  • Is this still the solution? Im on Name Value ---- ----- PSVersion 7.1.3 PSEdition Core GitCommitId 7.1.3 OS Darwin 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:31 PDT 2021; root:xnu-7195.121.3~9/RELEASE_ARM… Platform Unix PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0 – jes516 Jul 22 '21 at 03:21
  • @jes516 No, it's a good error message about the module: https://stackoverflow.com/a/67792872/434034 – Louis Waweru Apr 08 '22 at 05:01