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

Multiple select-object in one powershell

$
0
0

I am piping the output of one PS command into another command, and then displaying the resultant set via the select-object command. However I am not able to display any field/column from the original powershell command. How can I make that happen? Any ideas/leads. Here is a sample of what I am trying to do. 

Get-Mailbox -OrganizationalUnit "mydomain/french" | select-object Alias | foreach { Get-ActiveSyncDeviceStatistics -Mailbox $_.alias} | select-object Identity, DeviceOS

I was hoping for a output like Alias, Identity, DeviceOS. However it is only displaying Identity, DeviceOS (which are the fields in the second select-object). 

Am I  missing something here? Is there some other way to do it? 


Project Manager FTC


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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