commands

^

Get-DbatoolsError

Author Chrissy LeMaire (@cl)
Availability Windows, Linux, macOS

 

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

Synopsis

Returns detailed dbatools-related error information

Description

Returns detailed dbatools-related error information

By default, it only returns the most recent error ($error[0])

Syntax

Get-DbatoolsError
    [[-First] <Int32>]
    [[-Last] <Int32>]
    [[-Skip] <Int32>]
    [-All]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Get-DbatoolsError

Returns detailed error information for the most recent dbatools error

Example: 2
PS C:\> Get-DbatoolsError -All

Returns detailed error information for all dbatools-related errors

Example: 3
PS C:\> Get-DbatoolsError -Last 1

Returns the oldest dbatools-related error in the pipeline

Optional Parameters

-First

Works like Select-Object -First 1

Alias
Required False
Pipeline false
Default Value 0
-Last

Works like Select-Object -Last 1

Alias
Required False
Pipeline false
Default Value 0
-Skip

Works like Select-Object -Skip 1

Alias
Required False
Pipeline false
Default Value 0
-All

Returns detailed information for all dbatools-related errors

Alias
Required False
Pipeline false
Default Value False