Invoke-DevartDataImport

Synopsis

Imports data from files into a database.

Description

This cmdlet imports data from the following file formats: Text, XLS, MS Access, XML, JSON, CSV, ODBC, and DBF.

Syntax

Invoke-DevartDataImport [-Connection <object>] [-Create <SwitchParameter>] [-InputFile <string>] [-InputTable <string>] [-Table <string>] -TemplateFile <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

-Create

Creates a new table to import the data into.

-Create <SwitchParameter>
Property Default value
Required False
Position Named
Default value False
Accept pipeline input False
Accept wildcard characters False

-InputFile

Specifies a file with the data to import. The option is unavailable when using an ODBC format.

-InputFile <string>
Property Default value
Required False
Position Named
Default value -
Accept pipeline input False
Accept wildcard characters False

-InputTable

Specifies a source table or view to import the data from. The option is available only for MS Access and ODBC formats.

-InputTable <string>
Property Default value
Required False
Position Named
Default value -
Accept pipeline input False
Accept wildcard characters False

-Table

Specifies the destination table for the imported data.

-Table <string>
Property Default value
Required False
Position Named
Default value -
Accept pipeline input False
Accept wildcard characters False

-TemplateFile

Specifies a template file (.dit) containing data import 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-DevartDataImport -Connection $connection -TemplateFile "C:\Temp\template.dit"

Related links

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