Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue where powershell json output is getting truncated #99

Open
vijendarp opened this issue Nov 14, 2019 · 1 comment
Open

Issue where powershell json output is getting truncated #99

vijendarp opened this issue Nov 14, 2019 · 1 comment

Comments

@vijendarp
Copy link

When we execute powershell commands (with convertto-json option) remotely using winrm client, we observe that the json output of powershell getting truncated.
Initially we thought this may be due to large output of powersheIl for some of the commands we are executing. But we started observing this issue even for commands which don't display larger output.
We are unable to figure out what the issue could be. Is this due to network latency?
Anyone workaround for this issue?
We are executing the powershell commands as below connecting remotely to windows 2016 server.
endpoint := winrm.NewEndpoint(Host, 5985, false, false, nil)
client, err := winrm.NewClient(endpoint, UserName, Password)
client.RunWithString(cmd , "")

@OmegaZero
Copy link

OmegaZero commented Oct 11, 2023

Did you ever figure this out? I'm having the same problem. I did some debugging and confirmed that the json is correctly made via ConvertTo-Json in the powershell, but then the stdout from the execution shows no data in the winrm after execution. I'm not sure why this occurs either, the powershell script exits with return code 0, there is nothing else to the script it just...doesn't have any response when it's read in from winrm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants