Skip to content

Invoke-LMCollectorDebugCommand

Terminal window
Invoke-LMCollectorDebugCommand -Id <Int32> -GroovyCommand <String> [-CommandHostName <String>]
[-CommandWildValue <String>] [-IncludeResult] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Terminal window
Invoke-LMCollectorDebugCommand -Id <Int32> -PoshCommand <String> [-CommandHostName <String>]
[-CommandWildValue <String>] [-IncludeResult] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Terminal window
Invoke-LMCollectorDebugCommand -Id <Int32> -DebugCommand <String> [-CommandHostName <String>]
[-CommandWildValue <String>] [-IncludeResult] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Terminal window
Invoke-LMCollectorDebugCommand -Name <String> -GroovyCommand <String> [-CommandHostName <String>]
[-CommandWildValue <String>] [-IncludeResult] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Terminal window
Invoke-LMCollectorDebugCommand -Name <String> -PoshCommand <String> [-CommandHostName <String>]
[-CommandWildValue <String>] [-IncludeResult] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Terminal window
Invoke-LMCollectorDebugCommand -Name <String> -DebugCommand <String> [-CommandHostName <String>]
[-CommandWildValue <String>] [-IncludeResult] [-ProgressAction <ActionPreference>] [<CommonParameters>]

The Invoke-LMCollectorDebugCommand function allows execution of debug, PowerShell, or Groovy commands on a specified LogicMonitor collector.

Terminal window
#Execute a debug command
Invoke-LMCollectorDebugCommand -Id 123 -DebugCommand "!account" -IncludeResult
Terminal window
#Execute a PowerShell command
Invoke-LMCollectorDebugCommand -Name "Collector1" -PoshCommand "Get-Process"

The ID of the collector. Required for Id parameter sets.

Type: Int32
Parameter Sets: Id-Groovy, Id-Posh, Id-Debug
Aliases:
Required: True
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

The name of the collector. Required for Name parameter sets.

Type: String
Parameter Sets: Name-Groovy, Name-Posh, Name-Debug
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

The debug command to execute. Required for Debug parameter sets.

Type: String
Parameter Sets: Id-Debug, Name-Debug
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

The PowerShell command to execute. Required for Posh parameter sets.

Type: String
Parameter Sets: Id-Posh, Name-Posh
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

The Groovy command to execute. Required for Groovy parameter sets.

Type: String
Parameter Sets: Id-Groovy, Name-Groovy
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

The hostname context for the command execution.

Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

The wild value context for the command execution.

Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Switch to wait for and include command execution results.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

Fill ProgressAction Description

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

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

None. You cannot pipe objects to this command.

Section titled “None. You cannot pipe objects to this command.”

Returns command execution results if IncludeResult is specified.

Section titled “Returns command execution results if IncludeResult is specified.”

You must run Connect-LMAccount before running this command.