1

Is it possible to get a fifth column with my current code ? Actually the output looks like that when I add the Column5:

Column1 : infra-1
Column2 : infra-852
Column3 : infra-12
Column4 : infra-99
Column5 : infra-25

The output without Column5:

Column1  Column2   Column3   Column4 
-------  -------   -------   ------- 
infra-1  infra-852 infra-12  infra-99

I use $csv | Select-Object Column1,Column2,Column3,Column4 to display it.

1 Answer 1

2

The "issue" you are facing is, that powershell start to show results in list-format, at 5 properties or more. You could either stop at 4 properties (don't think this will help you) or output via Format-Table:

$csv | Select-Object Column1,Column2,Column3,Column4 | Format-Table

You might need to use some of the switches (e.g. -Wrap)

update

Beware that the results you produce are only worth displaying. They loose their properties as powershell objects and you cannot use methods or properties the may have had before!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.