简体   繁体   English

PowerShell将Mac迁移到Windows的问题

[英]Problem with PowerShell Remoting Mac to Windows

I am trying to PS Remote from my Mac to a server we have in our datacenter. 我正在尝试将Mac上的PS Remote传输到数据中心中的服务器。

I have configured both machines as per Microsoft's SSH Remoting In PowerShell Core document. 我已经按照Microsoft的《 PowerShell Core中SSH远程处理》文档配置了两台计算机。

Things that work: 起作用的东西:

  • PS Remote from my Windows Laptop to the Mac 从我的Windows笔记本电脑到Mac的PS Remote
  • SSH from the Mac to the Server (I see PowerShell Core running, but only by using the ssh command) 从Mac到服务器的SSH(我看到PowerShell Core正在运行,但只能使用ssh命令)

I am receiving the error below 我收到以下错误

PS /Users/username> New-PSSession -HostName WinComputer -UserName username
username@WinComputer's password: 
New-PSSession : [WinComputer] There is an error processing data from the background process. Error reported: Usage: pwsh[.exe] [[-File] <filePath> [args]].
At line:1 char:1
+ New-PSSession -HostName WinComputer -UserName username
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : OpenError: (System.Management.A\u2026tion.RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : 2102,PSSessionOpenFailed

Has anyone experienced anything similar? 有没有人经历过类似的经历? I cannot find a list of the error IDs for PSSessions. 我找不到PSSession的错误ID列表。

It seems strange that ssh username@WinComputer is sending me through to a PowerShell Core session and New-PSSession or Enter-PSSession are not working. ssh username@WinComputer将我发送到PowerShell Core会话,并且New-PSSession或Enter-PSSession无法正常工作,这似乎很奇怪。 I was initially prompted to accept the host fingerprint, but I am getting no further. 最初提示我接受主机指纹,但是我没有得到更多。

I have seen a similar issue on GitHub - New-PSSession using SSH Key Auth , however I am not trying to use a key to connect. 我在GitHub上看到了类似的问题- 使用SSH密钥验证的New-PSSession ,但是我没有尝试使用密钥进行连接。

By the way, I have tried with the -SSHTransport switch and adding/removing the domain name, it makes no difference. 顺便说一句,我尝试使用-SSHTransport开关并添加/删除域名,这没有什么区别。

Versions of Core: 核心版本:

Mac: 6.2.2 Mac:6.2.2
Windows Core Server: 6.1.2 Windows核心服务器:6.1.2
Windows Laptop: 6.1.0 Windows笔记本电脑:6.1.0

I have not read anything that says that versions of Core need to be the same minor release version. 我还没有读过任何内容说Core版本必须是相同的次要发行版本。

Couldn't find anything that I had done wrong. 找不到我做错的任何事情。 Rebooted the Windows Server and it all started working. 重新启动Windows Server,它全部开始工作。 Amateur . 业余的

Didn't expect that to be necessary, but at least this is an example for anyone else who runs in to this. 没想到这是必要的,但是至少对于其他参与此操作的人来说,这是一个示例。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM