Invoke-DevartDataExport

Synopsis

Exports data from a database into files.

Description

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.

Syntax

Invoke-DevartDataExport -TemplateFile <string> [-Connection <object>] [-OutputFile <string>] [-OutputTable <string>] [-Range <string>] [-SingleFile <SwitchParameter>] [-Table <string>] [<CommonParameters>]

Parameters

-Connection

Specifies the database connection to use. You can provide one of the following options:

  • A DevartDatabaseConnectionInfo object that contains detailed connection settings.
  • A connection string that defines how to connect to the database.
-Connection <object>
Property Default value
Required False
Position Named
Default value -
Accept pipeline input False
Accept wildcard characters False

-OutputFile

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

-OutputTable

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

-Range

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

-SingleFile

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

-Table

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

-TemplateFile

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

Common parameters

<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.

Output

System.Boolean (returns true on success and false otherwise)

System.Boolean returns:

  • true if the operation was successful.
  • false if the operation failed.

Example

Invoke-DevartDataExport -Connection $connection -TemplateFile "C:\Temp\template.det"

Related links

For information on additional command-line options, see Switches used in the command line.