Hacker News new | past | comments | ask | show | jobs | submit login

Export-Csv will know that you want to export all publicly available properties (ie visible aspects) of the objects it is being fed. If you want to restrict it, you only need to use the select command to filter it down, ie generate new objects with only a subset of the information.

To modify my example to only export service name and descriptive name:

     Get-Service | where {$_.Status -eq "Running" } | select Name, DisplayName | Export-Csv services.csv



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: