我试图在MacOS(Monterey M1)通过Visual Studio Code运行和调试一个适用于远程Windows PC的PowerShell脚本。
Mac
Name Value
---- -----
PSVersion 7.2.1
PSEdition Core
GitCommitId 7.2.1
OS Darwin 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.6…
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
个人计算机
Name Value
---- -----
PSVersion 7.2.1
PSEdition Core
GitCommitId 7.2.1
OS Microsoft Windows 10.0.19043
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
在 Mac 上,我已经安装了 PSWSMan
并按照这篇文章 https://petri.com/how-to-run-code-remotely-in-visual-studio-code 的指引尝试使用以下命令来启动远程会话:
Enter-PSSession -ComputerName '192.168.1.185' -Credential xxx
系统在密码输入后立即抛出此错误:
Enter-PSSession: Connecting to remote server 192.168.1.185 failed with the following error message : MI_RESULT_FAILED For more information, see the about_Remote_Troubleshooting Help topic.
这可能是由于NTLM不兼容引起的:https://github.com/dotnet/runtime/issues/887 有人成功地运行了这个方案吗?