My goal is to use the Show-ListView function available in Sitecore Powershell to show a dynamic number of columns. I'm currently executing the Show-ListView function as follows:
$table |
Show-ListView @props -Property @{ Label = "Item"; Expression = { $_.Item} },
@{ Label = "Page Type"; Expression = { $_.PageType } },
@{ Label = "Path"; Expression = { $_.Path} },
@{ Label = "en"; Expression = { $_.'en' } },
@{ Label = "en-AU"; Expression = { $_.'en-au' } },
@{ Label = "en-CA"; Expression = { $_.'en-ca' } },
@{ Label = "en-GB"; Expression = { $_.'en-gb' } },
@{ Label = "en-IN"; Expression = { $_.'en-in' } },
@{ Label = "en-SG"; Expression = { $_.'en-sg' } },
@{ Label = "fr-CA"; Expression = { $_.'fr-ca' } },
@{ Label = "ja-JP"; Expression = { $_.'ja-jp' } },
@{ Label = "zh-CN"; Expression = { $_.'zh-cn' } }
I'd like for the list of languages printed to be dynamic based on input I'm gathering from the user. I've already successfully read in the user input using the Read-Variable
function but I'm not sure if there is a way to use this list to dynamically generate columns.
Is this possible using the built-in Sitecore Powershell functions or does the column generation have to be exclusively static?