Skip to content

Write-GitHubLog

SYNOPSIS

Write a colored message in GitHub Actions or locally

SYNTAX

__AllParameterSets

Write-GitHubLog [-Message] <string> [-ForegroundColor <ConsoleColor>]
 [-BackgroundColor <ConsoleColor>] [<CommonParameters>]

ALIASES

This cmdlet has the following aliases, {{Insert list of aliases}}

DESCRIPTION

Write a colored message in GitHub Actions or locally with ANSI color support. When running in GitHub Actions, uses ANSI color codes for text formatting. When not running in GitHub Actions, uses standard Write-Host.

EXAMPLES

EXAMPLE 1

Write-GitHubLog -Message 'Hello, World!'

Writes 'Hello, World!' to the log.

EXAMPLE 2

Write-GitHubLog -Message 'Error occurred!' -ForegroundColor Red

Writes 'Error occurred!' in red text.

EXAMPLE 3

Write-GitHubLog -Message 'Success!' -ForegroundColor Green -BackgroundColor Black

Writes 'Success!' in green text on a black background.

PARAMETERS

-BackgroundColor

Background color for the message

Type: System.ConsoleColor
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-ForegroundColor

Foreground color for the message

Type: System.ConsoleColor
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Message

The message to display

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: true
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.String

{{ Fill in the Description }}

OUTPUTS

System.Void

{{ Fill in the Description }}

NOTES

Uses PowerShell's $PSStyle for ANSI color rendering when supported.