For the complete documentation index, see llms.txt. This page is also available as Markdown.

Write-PSULog

Writes a log to the PowerShell Universal logging system.

SYNOPSIS

Writes a log to the PowerShell Universal logging system.

SYNTAX

Write-PSULog [-Message] <String> [-Feature <String>] [-Resource <String>] [-Level <AgentLogLevel>]
 [-Properties <Hashtable>] [-Console] [<CommonParameters>]

DESCRIPTION

Writes a log to the PowerShell Universal logging system.

EXAMPLES

Example 1

PS C:\> Write-PSULog -Message "Hello" -Level 'Error'

Writes an error log to the PowerShell Universal logging system.

PARAMETERS

-Feature

The feature that is writing the log. This is typically the name of the feature group. For example, 'App' or 'API'.

-Level

The level of the log. This can be Error, Warning, Information or Debug.

-Message

The message to write to the log.

-Properties

Additional properties to write to the log. This should be a hashtable of key/value pairs.

-Resource

The resource to associate this log message to. This may be an app, API or script.

-Console

Also writes the log entry to the console output.

CommonParameters

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

INPUTS

None

OUTPUTS

System.Object

NOTES

Last updated

Was this helpful?