Exports data from a database into files.
This cmdlet exports data from one or multiple tables to the following file formats: HTML, Text, XLS, XLSX, MS Access, RTF, PDF, JSON, XML, CSV, ODBC, DBF, and SQL.
Invoke-DevartDataExport -TemplateFile <string> [-Connection <object>] [-OutputFile <string>] [-OutputTable <string>] [-Range <string>] [-SingleFile <SwitchParameter>] [-Table <string>] [<CommonParameters>]
Specifies the database connection to use. You can provide one of the following options:
DevartDatabaseConnectionInfo object that contains detailed connection settings.-Connection <object>
| Property | Default value |
|---|---|
| Required | False |
| Position | Named |
| Default value | - |
| Accept pipeline input | False |
| Accept wildcard characters | False |
Specifies the destination file or directory for multiple exported files. The option is unavailable when using an ODBC format.
-OutputFile <string>
| Property | Default value |
|---|---|
| Required | False |
| Position | Named |
| Default value | - |
| Accept pipeline input | False |
| Accept wildcard characters | False |
Specifies the destination table name. This option is available only when using SQL, ODBC, and Access formats.
-OutputTable <string>
| Property | Default value |
|---|---|
| Required | False |
| Position | Named |
| Default value | - |
| Accept pipeline input | False |
| Accept wildcard characters | False |
Specifies a range of exported rows:
all – Exports all rows.start:<startfrom> – Specifies the 1-based number of the row to start the data export from.length:<count> – Specifies the number of rows for export.-Range all|<start:<startfrom> length:<count>
| Property | Default value |
|---|---|
| Required | False |
| Position | Named |
| Default value | - |
| Accept pipeline input | False |
| Accept wildcard characters | False |
Exports all data into a single file, regardless of the number of source tables.
-SingleFile <SwitchParameter>
| Property | Default value |
|---|---|
| Required | False |
| Position | Named |
| Default value | False |
| Accept pipeline input | False |
| Accept wildcard characters | False |
Specifies one or more source table names.
-Table <string>
| Property | Default value |
|---|---|
| Required | False |
| Position | Named |
| Default value | - |
| Accept pipeline input | False |
| Accept wildcard characters | False |
Specifies a template file (.det) containing data export settings.
-TemplateFile <string>
| Property | Default value |
|---|---|
| Required | True |
| Position | Named |
| Default value | - |
| Accept pipeline input | False |
| Accept wildcard characters | False |
<CommonParameters>
This cmdlet supports these common parameters:
Verbose – Provides detailed output about the command operation.Debug – Provides debugging information.ErrorAction – Specifies how to respond to errors.ErrorVariable – Stores error messages in a variable.WarningAction – Specifies how to respond to warnings.WarningVariable – Stores warning messages in a variable.InformationAction – Specifies how informational messages are handled.InformationVariable – Stores informational messages in a variable.OutBuffer – Controls the number of objects buffered before output.PipelineVariable – Stores the current pipeline object in a variable.OutVariable – Stores output objects in a variable.For more information, see About Common Parameters.
System.Boolean (returns true on success and false otherwise)
System.Boolean returns:
true if the operation was successful.false if the operation failed.Invoke-DevartDataExport -Connection $connection -TemplateFile "C:\Temp\template.det"
For information on additional command-line options, see Switches used in the command line.