When sending PSObjects down the pipeline with only one or two properties, is there a way to force the default display to left align without using another pipeline invocation?
Your question is to vague to give a helpful answer … could you explain that more precicly or show some code example?
New-Object -TypeName PSObject -Property @{ ComputerName = $env:COMPUTERNAME AdDomain = $env:USERDOMAIN } | Format-Table ComputerName, AdDomain -Auto
Hi Sam,
That was what I was trying to avoid (a pipeline invocation of Format-Table). What I wondered was if there was a means to override the default display of an object by possibly modifying it.
I can certainly pipe the output the output of the cmdlet to FT if that is the only solution.
I wonder why the default settings seem to left align output when only one or two fields are present? Seems odd and un-intuitive…
Hmmm … I guess I have an idea of what you’re after. I did not use it but I heard of it in this video from Don Jones and Jeffrey Snover Explore Powershell … the part I mean starts at about 35 minutes