Formats SQL files.
The cmdlet allows you to format multiple SQL script files or even folders with SQL script files.
Invoke-DevartFormatScript -Source <object> [-Connection <object>] [-Encoding <string>] [-FileExtension <string>] [-IncludeSubfolders <SwitchParameter>] [-Output <string>] [-Profile <string>] [<CommonParameters>]
-Source <object>
Specifies the source SQL file or a folder with the files to be formatted.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Connection <object>
The DevartDatabaseConnectionInfo or connection string.
Required? false
Position? named
Default value
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
Default value
Accept pipeline input? false
Accept wildcard characters? false
-FileExtension <string>
Specifies the extension of the sourcefolder files that will be formatted.
The .sql extension is chosen by default.
Required? false
Position? named
Default value
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
Derfault value
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
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the following common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, InformationAction, InformationVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see About CommonParameters.
System.Boolean (returns true on success and false otherwise)
---------- EXAMPLE 1 ----------
Invoke-DevartFormatScript -Source "C:\Temp\actor.sql" -Output "C:\Temp\new_actor.sql"
See Formatting using the command line for information on additional command line options.