简体   繁体   English

在Windows 10上通过PowerShell连接树莓派时出现WinRM错误

[英]WinRM error while connecting to raspberry pi through PowerShell on Windows 10

I am trying to connect to the raspberry pi 2 and change the device name through PowerShell. 我试图连接到树莓派2并通过PowerShell更改设备名称。 On entering the following command I get an error. 输入以下命令后,我得到一个错误。

Enter-PsSession -ComputerName XX.XX.XXX.177 -Credential XX.XX.XXX.177\\Administrator Enter-PsSession-计算机名XX.XX.XXX.177-凭据XX.XX.XXX.177 \\管理员

Error: 错误:

Enter-PsSession : Connecting to remote server XX.XX.XXX.177 failed with the following error message : WinRM cannot complete the operation. Enter-PsSession:连接到远程服务器XX.XX.XXX.177失败,并显示以下错误消息:WinRM无法完成操作。 Verify that th specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer. 验证指定的计算机名称是否有效,可通过网络访问该计算机以及是否已启用WinRM服务的防火墙例外并允许该计算机进行访问。 By default, the WinRM firewall exception fo public profiles limits access to remote computers within the same local subnet. 默认情况下,公共配置文件的WinRM防火墙例外会限制对同一本地子网内的远程计算机的访问。 For more information, see the about_Remote_Troubleshooting Help topic At line:1 char:1 + Enter-PsSession -ComputerName XX.XX.XXX.177 -Credential XX.XX.XXX.177 ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (XX.XX.XXX.177:String) [Enter- SSession], PSRemotingTransportException + FullyQualifiedErrorId : CreateRemoteRunspaceFailed 有关更多信息,请参见about_Remote_Troubleshooting帮助主题,位于第1行:char:1 + Enter-PsSession -ComputerName XX.XX.XXX.177-凭据XX.XX.XXX.177 ... + ~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ + + CategoryInfo:InvalidArgument:(XX.XX.XXX.177:String)[Enter- SSession],PSRemotingTransportException + FullyQualifiedErrorId:CreateRemoteRunspaceFailed

ANy leads / help will be highly appreciated. 潜在客户/帮助将受到高度赞赏。 Thanks in advance :) 提前致谢 :)

This Answer here seems to do the trick without having to re-flash the SD Card 这个答案在这里似乎这样的伎俩,而无需再闪SD卡

ADDED BASED ON FEEDBACK 根据反馈添加

The link essentially suggests that the user run the following commands when trying to establish the connection 该链接实质上建议用户在尝试建立连接时运行以下命令

net start WinRM
Set-Item WSMan:\localhost\Client\TrustedHosts -Value MINWINPC
remove-module psreadline -force
Enter-PsSession -ComputerName MINWINPC -Credential MINWINPC\Administrator

I believe the "magic" difference is the forced command: 我相信“魔术”差异是强制命令:

remove-module psreadline -force

As per the recommendations in comments I tried various things. 根据评论中的建议,我尝试了各种方法。 I did the PSRemoting setup 我做了PSRemoting设置

Enable -PSRemoting -force 启用-PSRemoting -force

Finally, I removed the memory card from RaspberryPi formatted again and reinstalled Windows 10 IOT Core and then it worked perfectly fine. 最后,我从格式化后的RaspberryPi中取出了存储卡,然后重新安装了Windows 10 IOT Core,然后运行得非常好。 :) :)

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

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