When I run following command on powershell window (version 5.1)
(Get-Service *someServiceName*).status
I get output in 3 columns as follows:
PSComputerName RunspaceId Value
-------------- ---------- -----
xxxxx xxxxxx Running
On the other hand, when I run following command on same powershell window:
powershell -command "(Get-Service *someServiceName*).status"
I get following output:
Running
Please note that I am running above commands through remote conenction.
Why is it so ? why the output format is different in the two cases though we are running the same command. what could be the issue ? On most of the machines, the two kinds of command always behave in similar way, but this is not the case on my machine. Why ?