New-LMRemediationSource
Syntax
Section titled “Syntax”Default (Default)
Section titled “Default (Default)”New-LMRemediationSource -Name <String> [-Description <String>] [-AppliesTo <String>] [-Technology <String>] [-Tags <String>] [-Group <String>] [-ScriptType <String>] [-GroovyScript <String>] [-AccessGroupIds <Int32[]>] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]InputObject
Section titled “InputObject”New-LMRemediationSource -InputObject <PSObject> [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]Description
Section titled “Description”The New-LMRemediationSource function creates a new remediation source in LogicMonitor. You can specify individual parameters or provide a complete configuration object using the InputObject parameter.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”# Create a new remediation source using explicit parametersNew-LMRemediationSource -Name "MyRemediationSource" -Description "Restarts service" -ScriptType "powershell" -GroovyScript "Restart-Service MyService"Example 2
Section titled “Example 2”# Create a new remediation source using an InputObject$config = @{ name = "MyRemediationSource" description = "Restarts service" scriptType = "powershell" groovyScript = "Restart-Service MyService"}New-LMRemediationSource -InputObject $configParameters
Section titled “Parameters”-InputObject
Section titled “-InputObject”A PSCustomObject containing the complete remediation source configuration. Must follow the schema model defined in LogicMonitor’s API documentation. Use this parameter for advanced or programmatic scenarios.
Type: PSObjectParameter Sets: InputObjectAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: FalseThe name of the remediation source. This parameter is mandatory when using explicit parameters.
Type: StringParameter Sets: DefaultAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-Description
Section titled “-Description”The description for the remediation source.
Type: StringParameter Sets: DefaultAliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-AppliesTo
Section titled “-AppliesTo”The AppliesTo expression for the remediation source.
Type: StringParameter Sets: DefaultAliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-Technology
Section titled “-Technology”The technical notes for the remediation source.
Type: StringParameter Sets: DefaultAliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: FalseThe tags to associate with the remediation source.
Type: StringParameter Sets: DefaultAliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-Group
Section titled “-Group”The group the remediation source belongs to.
Type: StringParameter Sets: DefaultAliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-ScriptType
Section titled “-ScriptType”The script type for the remediation source. Valid values are ‘groovy’ or ‘powershell’. Defaults to ‘groovy’.
Type: StringParameter Sets: DefaultAliases:
Required: FalsePosition: NamedDefault value: GroovyAccept pipeline input: FalseAccept wildcard characters: False-GroovyScript
Section titled “-GroovyScript”The script content for the remediation source.
Type: StringParameter Sets: DefaultAliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-AccessGroupIds
Section titled “-AccessGroupIds”An array of Access Group IDs to assign to the remediation source.
Type: Int32[]Parameter Sets: DefaultAliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-WhatIf
Section titled “-WhatIf”Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameterParameter Sets: (All)Aliases: wi
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-Confirm
Section titled “-Confirm”Prompts you for confirmation before running the cmdlet.
Type: SwitchParameterParameter Sets: (All)Aliases: cf
Required: FalsePosition: NamedDefault value: NoneAccept 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 LogicMonitor.RemediationSource object.
Section titled “Returns LogicMonitor.RemediationSource object.”You must run Connect-LMAccount before running this command. For remediation source schema details, see the LogicMonitor API documentation.