Write-DebugMessage

SYNOPSIS

Writes a debug message while preserving the current debug preference.

SYNTAX

Write-AtlassianDebugMessage [[-Message] <String>] [-BreakPoint] [[-Cmdlet] <PSCmdlet>] [<CommonParameters>]

DESCRIPTION

Writes debug output and restores the original $DebugPreference value after processing.

Message formatting follows the configured message style settings (Breadcrumbs, Indent, FunctionName, and TimeStamp).

EXAMPLES

EXAMPLE 1

$DebugPreference = 'Continue'
Write-AtlassianDebugMessage -Message 'Shared runtime diagnostic message.'

Writes the debug message and keeps the same debug preference in scope.

EXAMPLE 2

Set-AtlassianConfiguration -Name Message -Value ([AtlassianPS.MessageStyle]::new(2, $false, $true, $false))
Write-AtlassianDebugMessage -Message 'Shared runtime diagnostic message.'

Writes a breadcrumb line and an indented debug message based on the configured message style.

PARAMETERS

-Message

Message to write to the debug stream.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-BreakPoint

When set, preserves the current debug preference behavior instead of forcing Continue.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Cmdlet

Optional cmdlet context used by legacy callers.

Type: PSCmdlet
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: $PSCmdlet
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

INPUTS

System.String

OUTPUTS

None

NOTES

Write-NonTerminatingError

On this page