0

How do I make my headers bold when they get outputted in my code below:

$Header = "Account,Ace String,Object Path"

And if I want this last line to be outputted under the same column header within csv, how do i do that:

$OutInfo = $Folder.Fullname + "," + $ACL.IdentityReference  + "," + $ACL.AccessControlType + "," + $ACL.IsInherited + "," + $ACL.InheritanceFlags + "," + $ACL.PropagationFlags

I want ($ACL.AccessControlType, $ACL.IsInherited, $ACL.InheritanceFLags and $ACL.Propagations flagsto be displayed under the column header of Object Path.

1 Answer 1

2

You have two questions here.

For the first: The CSV file format has no styling/formatting capabilities. It's just plain text, with delimited columns. IOW, what you're asking can't be done if you want to keep using CSV output.

For the second: You're breaking your CSV file by having more columns of data than you do in your headers. This is going to prove to be a mess.

Better solution: Pull all your data together into a collection of objects (a 2-dimensional array, basically), then pipe that collection through export-csv

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

1 Comment

I think I understand what you are saying, let me try and create a 2 dimensional array for outputting the file.

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.