Invoke-LMCollectorDebugCommand
Syntax
Section titled “Syntax”Id-Groovy
Section titled “Id-Groovy”Invoke-LMCollectorDebugCommand -Id <Int32> -GroovyCommand <String> [-CommandHostName <String>] [-CommandWildValue <String>] [-IncludeResult] [-ProgressAction <ActionPreference>] [<CommonParameters>]Id-Posh
Section titled “Id-Posh”Invoke-LMCollectorDebugCommand -Id <Int32> -PoshCommand <String> [-CommandHostName <String>] [-CommandWildValue <String>] [-IncludeResult] [-ProgressAction <ActionPreference>] [<CommonParameters>]Id-Debug
Section titled “Id-Debug”Invoke-LMCollectorDebugCommand -Id <Int32> -DebugCommand <String> [-CommandHostName <String>] [-CommandWildValue <String>] [-IncludeResult] [-ProgressAction <ActionPreference>] [<CommonParameters>]Name-Groovy
Section titled “Name-Groovy”Invoke-LMCollectorDebugCommand -Name <String> -GroovyCommand <String> [-CommandHostName <String>] [-CommandWildValue <String>] [-IncludeResult] [-ProgressAction <ActionPreference>] [<CommonParameters>]Name-Posh
Section titled “Name-Posh”Invoke-LMCollectorDebugCommand -Name <String> -PoshCommand <String> [-CommandHostName <String>] [-CommandWildValue <String>] [-IncludeResult] [-ProgressAction <ActionPreference>] [<CommonParameters>]Name-Debug
Section titled “Name-Debug”Invoke-LMCollectorDebugCommand -Name <String> -DebugCommand <String> [-CommandHostName <String>] [-CommandWildValue <String>] [-IncludeResult] [-ProgressAction <ActionPreference>] [<CommonParameters>]Description
Section titled “Description”The Invoke-LMCollectorDebugCommand function allows execution of debug, PowerShell, or Groovy commands on a specified LogicMonitor collector.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”#Execute a debug commandInvoke-LMCollectorDebugCommand -Id 123 -DebugCommand "!account" -IncludeResultExample 2
Section titled “Example 2”#Execute a PowerShell commandInvoke-LMCollectorDebugCommand -Name "Collector1" -PoshCommand "Get-Process"Parameters
Section titled “Parameters”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: FalseThe 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
Section titled “-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
Section titled “-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
Section titled “-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
Section titled “-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
Section titled “-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
Section titled “-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
Section titled “-ProgressAction”Fill ProgressAction Description
Type: ActionPreferenceParameter Sets: (All)Aliases: proga
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: FalseCommonParameters
Section titled “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
Section titled “Inputs”None. You cannot pipe objects to this command.
Section titled “None. You cannot pipe objects to this command.”Outputs
Section titled “Outputs”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.