[英]Error "no supported WSMan client library was found." with macOS pwsh
From macOS Terminal, when I execute:从 macOS 终端,当我执行时:
pwsh -command "Enter-PSSession myhost"
I get error from PowerShell:我从 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.我花了 2 个小时来寻找解决方案。 I am going to answer my own question.
我要回答我自己的问题。
Here's what I did:这是我所做的:
pwsh -Command 'Install-Module -Name PSWSMan'
sudo pwsh -Command 'Install-WSMan'
This followings work on Mac without issue.以下内容可在 Mac 上正常运行。
pwsh -Command 'Install-Module -Name PSWSMan'
sudo pwsh -Command 'Install-WSMan'
Root cause of the issue is Powershell dependency to previous openssl version.问题的根本原因是 Powershell 依赖于以前的 openssl 版本。 It is apparently not easy to fix according to GitHub issue PowerShell/#5561 .
根据 GitHub 问题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
See from Matt Thornton: Exchange Online Powershell on macOS参见 Matt Thornton: 在 macOS 上在线交换 Powershell
Tested below on MacOS 11.6在 MacOS 11.6 上测试如下
brew install powershell
brew install openssl
pwsh
Install-Module -Name PowerShellGet
Install-Module -Name PSWSMan
sudo pwsh -Command 'Install-WSMan'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.