5

I have a Windows 10 host machine that connects to a Hyper-V Windows 10 VM hosted on the same box. I've been following along the Pluralsight PowerShell tutorial. I'm trying to get the services available on a remote computer.

I can start a session on the remote computer with the following command:

Enter-PSSession -ComputerName Client1 -Credential username

Once the session has started and I am connected, I attempt to call Get-Service to identify the services on the client computer.

[Client1]: PS C:\Users\username\Documents>Get-Service

When I run the above command, I get the following error message:

Remote host method get_WindowSize is not implemented.
    + CategoryInfo          : ResourceUnavailable: (:) [out-lineoutput], PSRemotingDataStructureException
    + FullyQualifiedErrorId : System.Management.Automation.Remoting.PSRemotingDataStructureException,Microsoft.PowerShell.Commands.OutLineOutputCommand

I am running the same version of PowerShell on the host and client machines (5.1.18362.145). I assume that somehow this is an issue on the client machine?

Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
JohnB
  • 3,921
  • 8
  • 49
  • 99
  • This is only an issue when I am running from PowerShell ISE. – JohnB Sep 10 '19 at 07:07
  • This might be a [broken update](https://social.technet.microsoft.com/Forums/en-US/67142783-2acd-4d54-aef2-8d89d71457c5/powershell-remoting-broken-in-windows-10-1903?forum=winserverTS) – Lieven Keersmaekers Sep 10 '19 at 09:11

2 Answers2

2

[Client1]: PS C:\Users\username\Documents>Get-Service | out-string

That should work, maybe a bug with PowerShell or new version of Windows 10

Other link : https://social.technet.microsoft.com/Forums/en-US/67142783-2acd-4d54-aef2-8d89d71457c5/powershell-remoting-broken-in-windows-10-1903?forum=winserverTS

2
"Remote host method get_WindowSize is not implemented."

This happens to all Remoting Sessions started With Powershell_ISE on the Client-Side. The workaround with Out-String sucks, it destroys the Result-Object of that call. Best fix so far is either using not ISE or embed your remote Procedure in a Script and call it with Powershell.exe

Really annoying...and not fixed by now.

Workaround Example: Instead of using enter-pssession and then asking for a result of running services, you could use: $YourServices=Invoke-command -ComputerName <computername> -ScriptBlock {get-service}. Then you have all Service-Stats in your Object $YourServices.

BSMP
  • 4,596
  • 8
  • 33
  • 44
  • Would be helpful to post the workaround you mention if possible. Your answer is not particularly helpful for those looking at a solution. – mhouston100 Feb 24 '20 at 00:45
  • 1
    Example: Instead using enter-pssession and then asking for a result of running services, you could use: $YourServices=Invoke-command -ComputerName -ScriptBlock {get-service} Then you have all Service-Stats in your Object $YourServices – Andreas Urbschat Feb 25 '20 at 17:59