I am connecting to a windows device from the host using ‘Open-Device’ in ‘Powershell’.
i have to run a command in remote PC and capture the output into a variable to process further, unable to do so. tried redirecting using ‘Out-String’, ‘Tee’ Operation, Redirect the out put to a file, extract data from STDOUT etc. nothing seems to be working.

Output is printing onto the STDOUT but could not extract

Code i tried.

'Open-Device <Device Serial Number>'
'cmdd dir'