and the displayed columns for ExcludedProcess and ExcludedPath are much more wider than the longest Path or FilePath that they contain, because of that, sometimes the ExcludedPath does not fit and it is completely excluded from the output. I’m just trying to display each path on a different line but within the same text block (one record/object)
I cannot test on my machine because I don’t have any exclusions but I think what you want will not work. You could try to make it a little easier on the eyes …
Thank you Olaf! The problem is that I’m not getting one path per row (which will look much nicer), the paths are listed one after another separated by commas.
That’s right. If you want to change that you would need to restructure the data you get in return what actually gives them another meaning.
What’s the actual purpose of that requirement? Why does it have to look exactly this way? In my experiences most of the time we do not query data to be displayed on the console. Either you need the data for further processing steps in PowerShell - in this case the format does not matter at all - or you need to show the data to some humans - then you may output it as simple lists or format it in Excel to look nice.
The purpose is to build custom commands and add them to a module that can be accessed by my colleagues which are not that familiar with PowerShell. the command will display the result on the console as well as save it to a txt and a csv list . The main interest is on the console, so that is why I want the paths on different rows.
I’d consider this as two completely different purposses. You should consider two separate ways of preparing the needed data for the different purposses.