Hi Tanmay Goel,
How do you run the commands on the remote VM? Can you post your script?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am trying to run a PowerShell command from a VM which is connected to other VM and command is actually running over second VM, although output is getting printed on the PowerShell but when I am trying to store it into a variable or file it is coming as empty.
I tried converting output into string I got this when I printed the variable: Microsoft.Texus.Shells.CommandResult
Even transcription is skipping the output.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.
Hi Tanmay Goel,
How do you run the commands on the remote VM? Can you post your script?
Open-Device <Device Serial Number> x = cmdd dir
We tried the above code, open-device to connect to the PC, x to save the output.
we tried with Tee, Redirection, Transcription etc.
Posted the same in Stackoverflow as well.
https://stackoverflow.com/questions/78272214/unable-to-capture-the-output-of-a-remote-command-in-powershell
I'm not sure what open-device is. It's not a PowerShell cmdlet that comes with Windows. Is it an executable or a custom PowerShell function?
It is from a powershell module TShell : Connect using TShell | Microsoft Learn