Skip to main content

Write-LXC1PSLogMessage

This cmdlet writes a user message to the PS log file, which can be used to mark the start and end of a block in a script. This is useful when debugging scripts or writing place-holders in log files.

Note
You cannot pipe objects to this cmdlet.

Syntax

Write-LXC1PSLogMessage  [-UserMessage String]
[-MachineID]
[-Identity]
[CommonParameter]

Parameters

-UserMessage String
If specified, writes a custom message in the final text that is to be written in PS log file.
-MachineID
If specified, writes the machine identity (machine name) in the final text that is to be written in PS log file.
-Identity
If specified, writes the user identity (username and domain if is the case) in the final text that is to be written in PS log file.
CommonParameters
This cmdlet supports the following common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable, -OutBuffer, -PipelineVariable, -OutVariable. For detailed information about each common parameter, see the Microsoft PowerShell Common Parameters webpage.

Results

This cmdlet does not return any data.

Examples

  • The following example writes a full message in the PS log file, where the -UserMessage parameter contains the full name of the current script.
    Write-LXC1PSLogMessage -Identity `
    -MachineId `
    –UserMessage "Starting '$PSCommandPath'"