简体   繁体   English

错误“找不到受支持的 WSMan 客户端库。” 使用 macOS pwsh

[英]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 上测试如下

  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'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在 .NET 核心中运行远程 Powershell 命令:找不到支持的 WSMan 客户端库 - Cannot run remote Powershell command in .NET Core: no supported WSMan client library was found 在 MacOS 上使用 GPS 出现错误“ld: library not found for -lSystem” - Error “ld: library not found for -lSystem” with GPS on MacOS 在 MacOS 上 C++ GTest 错误“ld: library not found for -lgtest” - C++ GTest error “ld: library not found for -lgtest” on MacOS Mac OS X上的Java 9 Eclipse Neon错误“Target不是JDK根目录。 找不到系统库。“ - Java 9 on Mac OS X Eclipse Neon Error “Target is not a JDK root. System library was not found.” ld: 找不到 -lcrypto MacOS 的库 - ld: library not found for -lcrypto MacOS 在 MacOS 上找不到命令错误 - command not found error on MacOS macOS:找不到用于-lpaho-mqtt3c的库 - macOS: library not found for -lpaho-mqtt3c macOS llvm 编译:ld:找不到 -lomp 的库 - macOS llvm compilation : ld: library not found for -lomp 如何在 macos mojave 上修复“找不到 -lssl 的库” - How to fix “library not found for -lssl” on macos mojave 未找到 Python 库。 使用 Python 库的路径设置 PYTHON_LIBRARY 环境变量 - Python library not found. Set the PYTHON_LIBRARY environment variable with the path to a Python library
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM