我正在尝试使用PowerShell连接到amazon windows实例 . 我正在按照以下链接中的步骤操作:

我不能让这个工作 . 我是新的亚马逊CLI,过去几天我一直在努力连接到已经运行的Windows实例 .

我每次都会遇到同样的错误 . 我错过了什么吗?

enable-psremoting -force
set-item wsman:\localhost\Client\TrustedHosts -value "*" -force
$password = convertto-securestring -asplaintext -force -string "MY_PASSWORD_GOES_HEREr"
$credential = new-object -typename system.management.automation.pscredential -argumentlist "MY_USERNAME", $pa
ssword
$session = new-pssession x.x.x.x -credential $credential

new-pssession:[x.x.x.x]连接到远程服务器x.x.x.x失败,并显示以下错误消息:WinRM无法完成操作 . 验证指定的计算机名称是否有效,计算机是否可通过网络访问,以及是否启用了WinRM服务的防火墙例外,并允许从此计算机进行访问 . 默认情况下,公共配置文件的WinRM防火墙例外限制对同一本地子网内的远程计算机的访问 . 有关详细信息,请参阅about_Remote_Troubleshooting帮助主题 . 在行:1 char:12 $ session = new-pssession xxxx -credential $ credential ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~分类信息:OpenError :( System.Manageme .... RemoteRunspace:RemoteRunspace)[New-PSSession],PSRemotin gTransportException FullyQualifiedErrorId:WinRMOperationTimeout,PSSessionOpenFailed