Invoke-DevartFormatScript

Synopsis:

Formats the SQL files.

Description

The cmdlet allows you to format multiple SQL script files or even folders with SQL script files.

Syntax

Invoke-DevartFormatScript -Source <object> [-Connection <object>] [-Encoding <string>] [-FileExtention <string>] [-IncludeSubfolders <SwitchParameter>] [-Output <string>] [-Profile <string>] [<CommonParameters>]

Parameters

-Source <object>

Specifies the source SQL file or a folder with the files to be formatted.

Required? true

Position? named

Accept pipeline input? false

Accept wildcard characters? false

-Connection <object>

The DevartDatabaseConnectionInfo or connection string.

Required? false

Position? named

Accept pipeline input? false

Accept wildcard characters? false

-Encoding <string>

Specifies the encoding which should be applied to open and save files.

Required? false

Position? named

Accept pipeline input? false

Accept wildcard characters? false

-FileExtention <string>

Specifies the extension of the sourcefolder files that will be formatted.

The .sql extension is selected by default.

Required? false

Position? named

Accept pipeline input? false

Accept wildcard characters? false

-IncludeSubfolders <SwitchParameter>

Include the current directory and all subdirectories in search operation.

Required? false

Position? named

Default value false

Accept pipeline input? false

Accept wildcard characters? false

-Profile <string>

Specifies the path to file that contains formatting options settings.

If the parameter is not specified, default formatting options settings will be applied.

Required? false

Position? named

Accept pipeline input? false

Accept wildcard characters? false

-Output <string>

Specifies the output file or path name where formatting results will be saved.

If the parameter is not specified, the formatting results will be saved in the source file or folder.

Required? false

Position? named

Accept pipeline input? false

Accept wildcard characters? false

Outputs

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

Examples

---------- EXAMPLE 1 ----------
Invoke-DevartFormatScript -Source "C:\Temp\actor.sql" -Output "C:\Temp\new_actor.sql"