Я пытаюсь отправить и извлечь zip-файл на azure VM, но не могу установить соединение с удаленной Azure VM.
Код
$cred = Get-Credential
$SO = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck
$session = New-PSSession -ConnectionUri 'http://xx.xx.xxx.xxx:3389' -Credential $cred -SessionOption $SO
Send-File -Path C:\testArchive.zip -Destination C:\ -Session $session
Expand-Archive -Path C:\testArchive.zip -DestinationPath C:\ -Session $session
Ошибка
New-PSSession : [xx.xx.xxx.xxx] Connecting to remote server xx.xx.xxx.xxx
failed with the following error message : The client cannot connect to the
destination specified in the request. Verify that the service on the
destination is running and is accepting requests. Consult the logs and
documentation for the WS-Management service running on the destination, most
commonly IIS or WinRM. If the destination is the WinRM service, run the
following command on the destination to analyze and configure the WinRM
service: "winrm quickconfig". For more information, see the
about_Remote_Troubleshooting Help topic.
At line:4 char:12
+ $session = New-PSSession -ConnectionUri 'http://xx.xx.xxx.xxx:3389' - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:Re
moteRunspace) [New-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : CannotConnect,PSSessionOpenFailed
Ниже приведен вывод при запуске winrm команда quickconfig 'на azure VM
WinRM service is already running on this machine.
WinRM is already set up for remote management on this computer.
Когда я запускаю' Enter-PSSession -ComputerName LoadTestVm -Port 3389 -Credential qa-admin '
Enter-PSSession : Connecting to remote server LoadTestVm failed with the following error
message : The WinRM client cannot process the request because the server name cannot be
resolved. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ Enter-PSSession -ComputerName LoadTestVm -Port 3389 -Credential qa-ad ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (LoadTestVm:String) [Enter-PSSession], PSRem
otingTransportException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed