2020-05-13 10:53:15 -04:00
|
|
|
<#
|
|
|
|
|
.SYNOPSIS
|
|
|
|
|
Default Cmdlet for printing plain messages to console
|
|
|
|
|
.DESCRIPTION
|
|
|
|
|
Default Cmdlet for printing plain messages to console
|
|
|
|
|
.FUNCTIONALITY
|
|
|
|
|
Default Cmdlet for printing plain messages to console
|
|
|
|
|
.EXAMPLE
|
|
|
|
|
PS>Write-IcingaConsolePlain -Message 'Test message: {0}' -Objects 'Hello World';
|
|
|
|
|
.PARAMETER Message
|
|
|
|
|
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
|
|
|
|
|
.PARAMETER Objects
|
|
|
|
|
An array of objects being added to a provided message. The index of the array position has to refer to the
|
|
|
|
|
message locations.
|
|
|
|
|
.INPUTS
|
|
|
|
|
System.String
|
|
|
|
|
.LINK
|
|
|
|
|
https://github.com/Icinga/icinga-powershell-framework
|
|
|
|
|
#>
|
|
|
|
|
|
|
|
|
|
function Write-IcingaConsolePlain()
|
|
|
|
|
{
|
|
|
|
|
param (
|
|
|
|
|
[string]$Message,
|
2021-02-19 04:09:42 -05:00
|
|
|
[array]$Objects,
|
|
|
|
|
[ValidateSet('Default', 'Black', 'DarkBlue', 'DarkGreen', 'DarkCyan', 'DarkRed', 'DarkMagenta', 'DarkYellow', 'Gray', 'DarkGray', 'Blue', 'Green', 'Cyan', 'Red', 'Magenta', 'Yellow', 'White')]
|
2021-08-18 09:05:53 -04:00
|
|
|
[string]$ForeColor = 'Default',
|
2021-09-09 12:53:48 -04:00
|
|
|
[switch]$NoNewLine = $FALSE,
|
|
|
|
|
[switch]$DropMessage = $FALSE
|
2020-05-13 10:53:15 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Write-IcingaConsoleOutput `
|
|
|
|
|
-Message $Message `
|
|
|
|
|
-Objects $Objects `
|
2021-02-19 04:09:42 -05:00
|
|
|
-ForeColor $ForeColor `
|
2021-08-18 09:05:53 -04:00
|
|
|
-Severity $null `
|
2021-09-09 12:53:48 -04:00
|
|
|
-NoNewLine:$NoNewLine `
|
|
|
|
|
-DropMessage:$DropMessage;
|
2020-05-13 10:53:15 -04:00
|
|
|
}
|