Powershell dot notation vs select-object
Can someone explain to me what is the difference between dot notation and select object in Powershell? How do these two property accessors differ from each other?
I noticed that launching (ls).name
gives basically the same results as ls | select-object name
, however launching ls | select-object name | export-csv foo.csv
gives me the correct csv file when I try (ls).name | export-csv foo.csv
it gives me a file length. In both cases, gettype () returns Object []
+3
source to share