Formatting issues / missing data when multiple commands use Select-Object within a script
I've run into a problem with my PowerShell scripts where I am "losing" output that was going to the console, or being redirected. After much legwork, I simplified it down to an easily documented example of the problem. Place the following single line in a script (test1.ps1), and invoke it from a basic PowerShell command window: Get-WmiObject win32_share | select name, path and you will likely get two columns of output similar to the following: PS C:\Users\me\temp> ./test1.ps1 name path ---- ---- ADMIN$ C:\Windows C$ C:\ IPC$ Users C:\Users but now, create a two line script (test2.ps1) like