Summary
Writes an 'error' log entry
Syntax
Write-LogError [-Message] <String> [[-Component] <String>] [[-File] <String>] [<CommonParameters>]
Description
This command writes an 'error' log entry to default output or a specified file.
Parameters
Name | Argument | Description |
---|---|---|
Message | <String> | Specifies the message to write |
Component | <String> | Specifies a 'Component' tag for the message entry. Some log readers use this parameter to group messages. If not specified, the component tag is 'General'. This parameter is ignored in 'Simple' mode due to backwards compatibility reasons. |
File | <String> | Specifies the file to update with the new log entry. If not specified, the log entry is written to pipeline. |
Examples
PS C:\> Write-LogError -Component "Repository" -Message "Something bad happened" -File myfile.log