< Back
Invoke-ChainsawMessage
Post
NAME Invoke-ChainsawMessage
SYNOPSIS
This will pass the message to all defined endpoints.
SYNTAX
Invoke-ChainsawMessage [-Emergency] [-Alert] [-Critical] [-Error] [-Warning] [-Notice] [-Info] [-Debug]
[[-Message] <String>] [[-ErrorCode] <Int32>] [[-CallingFile] <String>] [[-LineNumber] <Int32>] [<CommonParameters>]
DESCRIPTION
When you have a message from a process this will take care of all message routing for you.
PARAMETERS
-Emergency [<SwitchParameter>]
[switch] This will define the level of the message as Emergency.
Only define one of the switches.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Alert [<SwitchParameter>]
[switch] This will define the level of the message as Alert.
Only define one of the switches.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Critical [<SwitchParameter>]
[switch] This will define the level of the message as Critical.
Only define one of the switches.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Error [<SwitchParameter>]
[switch] This will define the level of the message as Error.
Only define one of the switches.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Warning [<SwitchParameter>]
[switch] This will define the level of the message as Warning.
Only define one of the switches.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Notice [<SwitchParameter>]
[switch] This will define the level of the message as Notice.
Only define one of the switches.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Info [<SwitchParameter>]
[switch] This will define the level of the message as Information.
Only define one of the switches.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Debug [<SwitchParameter>]
[switch] This will define the level of the message as Debug.
Only define one of the switches.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Message <String>
[string] This will define the log message that you want to have recorded.
Required? false
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-ErrorCode <Int32>
[int] This will let you define a custom error code if you wanted to.
Required? false
Position? 2
Default value 0
Accept pipeline input? false
Accept wildcard characters? false
-CallingFile <String>
[string] This will let you define the filename that the message came from.
Use Get-CurrentFileName as a helper
Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
-LineNumber <Int32>
[int] This will let you define the line number that the message came from.
Use Get-CurrentLineNumber as a helper
Required? false
Position? 4
Default value 0
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Invoke-ChainsawMessage -Debug -Message 'Testing Chainsaw'
Invoke-ChainsawMessage -Debug -Message 'Testing Chainsaw' -ErrorCode 100
Invoke-ChainsawMessage -Debug -Message 'Testing Chainsaw' -ErrorCode 100 -CallingFile $(Get-CurrentFileName)
Invoke-ChainsawMessage -Debug -Message 'Testing Chainsaw' -ErrorCode 100 -CallingFile $(Get-CurrentFileName)
-LineNumber $(Get-CurrentLineNumber)
RELATED LINKS
SYNOPSIS
This will pass the message to all defined endpoints.
SYNTAX
Invoke-ChainsawMessage [-Emergency] [-Alert] [-Critical] [-Error] [-Warning] [-Notice] [-Info] [-Debug]
[[-Message] <String>] [[-ErrorCode] <Int32>] [[-CallingFile] <String>] [[-LineNumber] <Int32>] [<CommonParameters>]
DESCRIPTION
When you have a message from a process this will take care of all message routing for you.
PARAMETERS
-Emergency [<SwitchParameter>]
[switch] This will define the level of the message as Emergency.
Only define one of the switches.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Alert [<SwitchParameter>]
[switch] This will define the level of the message as Alert.
Only define one of the switches.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Critical [<SwitchParameter>]
[switch] This will define the level of the message as Critical.
Only define one of the switches.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Error [<SwitchParameter>]
[switch] This will define the level of the message as Error.
Only define one of the switches.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Warning [<SwitchParameter>]
[switch] This will define the level of the message as Warning.
Only define one of the switches.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Notice [<SwitchParameter>]
[switch] This will define the level of the message as Notice.
Only define one of the switches.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Info [<SwitchParameter>]
[switch] This will define the level of the message as Information.
Only define one of the switches.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Debug [<SwitchParameter>]
[switch] This will define the level of the message as Debug.
Only define one of the switches.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Message <String>
[string] This will define the log message that you want to have recorded.
Required? false
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-ErrorCode <Int32>
[int] This will let you define a custom error code if you wanted to.
Required? false
Position? 2
Default value 0
Accept pipeline input? false
Accept wildcard characters? false
-CallingFile <String>
[string] This will let you define the filename that the message came from.
Use Get-CurrentFileName as a helper
Required? false
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
-LineNumber <Int32>
[int] This will let you define the line number that the message came from.
Use Get-CurrentLineNumber as a helper
Required? false
Position? 4
Default value 0
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Invoke-ChainsawMessage -Debug -Message 'Testing Chainsaw'
Invoke-ChainsawMessage -Debug -Message 'Testing Chainsaw' -ErrorCode 100
Invoke-ChainsawMessage -Debug -Message 'Testing Chainsaw' -ErrorCode 100 -CallingFile $(Get-CurrentFileName)
Invoke-ChainsawMessage -Debug -Message 'Testing Chainsaw' -ErrorCode 100 -CallingFile $(Get-CurrentFileName)
-LineNumber $(Get-CurrentLineNumber)
RELATED LINKS