Rendered columns -IncludeInExport

Product: PowerShell Universal
Version: 2.8.x


Is there a way to set a table’s export so that the rendered columns export as the rendered value instead of the original property value passed in?

For example, I have a table with rows of user account and a column “Domain” which I want to show “” which is rendered from the DistinguishedName, this work fine:

New-UDTableColumn -Property DistinguishedName -Title 'Domain' -Render {
	$dn = $EventData.DistinguishedName
	$domain = $dn -Split "," | ? {$_ -like "DC=*"}
	$domain = $domain -join "." -replace ("DC=", "")
} -IncludeInExport

and the column displays “” as expected, but the exported csv/xlsx/pdf etc names the column as “Domain” but instead of just “” (the rendered value) appearing, the whole DistinguishedName property is exported (e.g. CN=Jeff Smith,OU=Sales,DC=Fabrikam,DC=COM)

Anyone know a way to convert that for the export?


You could always hide that column from the export, and add an additional column which is hidden from the table but included in the export and has the data in the correct format already.