Product: PowerShell Universal
Version: 1.5.1
```
made a search and tried to export data, neither csv nor xslx works, a file called, "csv" or "xslx" got downloaded without data.
You will need to choose which columns you want to export using the -IncludeInExport parameter.
Table - PowerShell Universal (ironmansoftware.com)
$Columns = @(
New-UDTableColumn -Property Name -Title “Name” -IncludeInExport
New-UDTableColumn -Property Extension -Title “Extension” -IncludeInExport
New-UDTableColumn -Property Email -Title “Email” -IncludeInExport
New-UDTableColumn -Property Mobile -Title “Mobile” -IncludeInExport
New-UDTableColumn -Property Home -Title “Home” -IncludeInExport
)
Thanks for the reply, really cool feature.
Just thought I’d throw in here a way to dynamically create every column in the returned object…
$Columns = @(
$session:sqlQueryResult[0].psobject.Properties | foreach {
New-UDTableColumn -Property $_.Name -Title "$($_.Name)" -IncludeInExport
}
)
Might not be the best way to achieve this but there ya go. This means the -Export
parameter on New-UDTable
will export every column it has displayed.
I had this use-case for building a page that allows people to perform custom SQL queries from a dashboard that run as a user with limited access to the d/b. So the resulting columns of each query are unknown.