Quantcast
Channel: PowerShell General
Viewing all articles
Browse latest Browse all 10624

How do I Make columns in PSobject closer?

$
0
0

I'm using the following code format below:

$tobj =  New-Object PSObject
$tobj | Add-Member -Name "Server" -Value $Server -MemberType NoteProperty
$tobj | Add-Member -Name "Scenario" -Value $Arraypwshell.scenario -MemberType NoteProperty 
$tobj | Add-Member -Name "Result" -Value $arraypwshell.result -MemberType NoteProperty 
$tobj | Add-Member -Name "Error" -Value $arraypwshell.error -MemberType NoteProperty 
$object += $tobj

$object gets populated $tobj as I have above.  What I'm wanting to have happen is to have the categories "server" "scenario" and so on grouped closer together.  When $object is outputted to the screen, there is a lot of space between each column and some of the text gets cut off.  How would I bring each column closer together?  I know there is a way to do this with hash tables like @{"value = xx, value=xx}.  Anyone know how I could make this happen??


Viewing all articles
Browse latest Browse all 10624

Latest Images

Trending Articles



Latest Images