Invoke-LMCollectorDebugCommand
Syntax
Id-Groovy
Invoke-LMCollectorDebugCommand -Id <Int32> -GroovyCommand <String> [-CommandHostName <String>] [-CommandWildValue <String>] [-IncludeResult] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Id-Posh
Invoke-LMCollectorDebugCommand -Id <Int32> -PoshCommand <String> [-CommandHostName <String>] [-CommandWildValue <String>] [-IncludeResult] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Id-Debug
Invoke-LMCollectorDebugCommand -Id <Int32> -DebugCommand <String> [-CommandHostName <String>] [-CommandWildValue <String>] [-IncludeResult] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Name-Groovy
Invoke-LMCollectorDebugCommand -Name <String> -GroovyCommand <String> [-CommandHostName <String>] [-CommandWildValue <String>] [-IncludeResult] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Name-Posh
Invoke-LMCollectorDebugCommand -Name <String> -PoshCommand <String> [-CommandHostName <String>] [-CommandWildValue <String>] [-IncludeResult] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Name-Debug
Invoke-LMCollectorDebugCommand -Name <String> -DebugCommand <String> [-CommandHostName <String>] [-CommandWildValue <String>] [-IncludeResult] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Description
The Invoke-LMCollectorDebugCommand function allows execution of debug, PowerShell, or Groovy commands on a specified LogicMonitor collector.
Examples
Example 1
#Execute a debug commandInvoke-LMCollectorDebugCommand -Id 123 -DebugCommand "!account" -IncludeResult
Example 2
#Execute a PowerShell commandInvoke-LMCollectorDebugCommand -Name "Collector1" -PoshCommand "Get-Process"
Parameters
-Id
The ID of the collector. Required for Id parameter sets.
Type: Int32Parameter Sets: Id-Groovy, Id-Posh, Id-DebugAliases:
Required: TruePosition: NamedDefault value: 0Accept pipeline input: FalseAccept wildcard characters: False
-Name
The name of the collector. Required for Name parameter sets.
Type: StringParameter Sets: Name-Groovy, Name-Posh, Name-DebugAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-DebugCommand
The debug command to execute. Required for Debug parameter sets.
Type: StringParameter Sets: Id-Debug, Name-DebugAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-PoshCommand
The PowerShell command to execute. Required for Posh parameter sets.
Type: StringParameter Sets: Id-Posh, Name-PoshAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-GroovyCommand
The Groovy command to execute. Required for Groovy parameter sets.
Type: StringParameter Sets: Id-Groovy, Name-GroovyAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-CommandHostName
The hostname context for the command execution.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-CommandWildValue
The wild value context for the command execution.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
-IncludeResult
Switch to wait for and include command execution results.
Type: SwitchParameterParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: FalseAccept pipeline input: FalseAccept wildcard characters: False
-ProgressAction
Fill ProgressAction Description
Type: ActionPreferenceParameter Sets: (All)Aliases: proga
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
None. You cannot pipe objects to this command.
Outputs
Returns command execution results if IncludeResult is specified.
Notes
You must run Connect-LMAccount before running this command.