Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Why does Select-Object return more than requested?

$
0
0

Why does the following command return more attributes than in the Select?

$obj = Get-VM | Select VMName,State; $obj
VMName         : blah-blah
State          : Off
PSComputerName : host
RunspaceId     : URI

And how do I just get the value for State?

$obj = Get-VM | Select VMName,State; $obj.State
The above should do the trick but doesn't :(

Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>