commands

^

Invoke-DbatoolsFormatter

Author Simone Bizzotto
Availability Windows, Linux, macOS

 

Want to see the source code for this command? Check out Invoke-DbatoolsFormatter on GitHub.
Want to see the Bill Of Health for this command? Check out Invoke-DbatoolsFormatter.

Synopsis

Helps formatting function files to dbatools' standards

Description

Uses PSSA's Invoke-Formatter to format the target files and saves it without the BOM.

Syntax

Invoke-DbatoolsFormatter
    [-Path] <Object[]>
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Invoke-DbatoolsFormatter -Path C:\dbatools\public\Get-DbaDatabase.ps1

Reformats C:\dbatools\public\Get-DbaDatabase.ps1 to dbatools' standards

Required Parameters

-Path

The path to the ps1 file that needs to be formatted

Alias
Required True
Pipeline true (ByValue)
Default Value

Optional Parameters

-EnableException

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

Alias
Required False
Pipeline false
Default Value False