2020-05-13 10:53:15 -04:00
|
|
|
<#
|
|
|
|
|
.SYNOPSIS
|
2020-08-04 08:48:32 -04:00
|
|
|
Default Cmdlet for printing debug messages to console
|
2020-05-13 10:53:15 -04:00
|
|
|
.DESCRIPTION
|
2020-08-04 08:48:32 -04:00
|
|
|
Default Cmdlet for printing debug messages to console
|
2020-05-13 10:53:15 -04:00
|
|
|
.FUNCTIONALITY
|
2020-08-04 08:48:32 -04:00
|
|
|
Default Cmdlet for printing debug messages to console
|
2020-05-13 10:53:15 -04:00
|
|
|
.EXAMPLE
|
2020-08-04 08:48:32 -04:00
|
|
|
PS>Write-IcingaConsoleDebug -Message 'Test message: {0}' -Objects 'Hello World';
|
2020-05-13 10:53:15 -04:00
|
|
|
.PARAMETER Message
|
2020-08-04 08:48:32 -04:00
|
|
|
The message to print with {x} placeholdes replaced by content inside the Objects array. Replace x with the
|
|
|
|
|
number of the index from the objects array
|
2020-05-13 10:53:15 -04:00
|
|
|
.PARAMETER Objects
|
2020-08-04 08:48:32 -04:00
|
|
|
An array of objects being added to a provided message. The index of the array position has to refer to the
|
|
|
|
|
message locations.
|
2020-05-13 10:53:15 -04:00
|
|
|
.INPUTS
|
2020-08-04 08:48:32 -04:00
|
|
|
System.String
|
2020-05-13 10:53:15 -04:00
|
|
|
.LINK
|
2020-08-04 08:48:32 -04:00
|
|
|
https://github.com/Icinga/icinga-powershell-framework
|
2020-05-13 10:53:15 -04:00
|
|
|
#>
|
|
|
|
|
|
|
|
|
|
function Write-IcingaConsoleDebug()
|
|
|
|
|
{
|
2020-08-04 08:48:32 -04:00
|
|
|
param (
|
|
|
|
|
[string]$Message,
|
|
|
|
|
[array]$Objects
|
|
|
|
|
);
|
2020-05-13 10:53:15 -04:00
|
|
|
|
2020-08-04 08:48:32 -04:00
|
|
|
if ((Get-IcingaFrameworkDebugMode) -eq $FALSE) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2020-05-30 06:11:30 -04:00
|
|
|
|
2020-08-04 08:48:32 -04:00
|
|
|
Write-IcingaConsoleOutput `
|
|
|
|
|
-Message $Message `
|
|
|
|
|
-Objects $Objects `
|
|
|
|
|
-ForeColor 'Blue' `
|
|
|
|
|
-Severity 'Debug';
|
2020-05-13 10:53:15 -04:00
|
|
|
}
|