Releases: logicmonitor/lm-powershell-module
Releases · logicmonitor/lm-powershell-module
v7.9.2
Change List
7.9.2
Bug Fixes
- SDT timezone compatibility with PowerShell 5.1: Fixed an issue introduced in v7.9.1 where SDT commands would fail on PowerShell 5.1 with
Invalid timezoneerrors due to .NET Framework not supporting IANA timezone IDs (e.g.America/New_York) directly. - Cross-platform timezone support: SDT commands now accept both IANA timezone IDs (e.g.
America/New_York) and Windows standard timezone names (e.g.Eastern Standard Time). The module automatically resolves the input to the correct format for the API regardless of PowerShell version or operating system.
v7.9.1
7.9.1
Bug Fixes & Changes
- SDT timezone consistency: Added timezone-aware behavior across
New-LMDeviceSDT,New-LMDeviceGroupSDT,New-LMDeviceDatasourceSDT, andNew-LMDeviceDatasourceInstanceSDTso schedules are no longer interpreted based on the machine running the script. - Portal timezone default for SDTs: If
-Timezoneis omitted, SDT commands now resolve and use the portal timezone by default. - Timezone validation improvements: Replaced legacy commented timezone lists with active validation for timezone IDs and clearer error messages for invalid values.
- Set-LMSDT update alignment: Added timezone handling and validation improvements for one-time SDT updates in
Set-LMSDT.
v7.9
7.9
New Cmdlets
- Invoke-LMDiagnosticSource: Manually trigger a diagnostic source for a host using host
Id/Name/DisplayNameand diagnostic sourceDiagnosticId/DiagnosticNamelookups, with optionalAlertId. - Invoke-LMRemediationSource: Manually trigger a remediation source for a host using host
Id/Name/DisplayNameand remediation sourceRemediationId/RemediationNamelookups, with optionalAlertId.
Bug Fixes & Changes
- New-LMAlertRule: Fixed bug that caused an -EscalationInterval of 0 to be ignored when creating alert rules.
- Overhaul of GET cmdlet pagination logic: Centralized and standardized pagination behavior across GET cmdlets, including bug fixes for paging edge cases.
- Request error handling improvements: Added
CallerPSCmdletscoping to invoke request paths for more consistent error behavior and reporting. - Filter and lookup reliability updates: Improved filter building and fixed not-found loop handling in affected cmdlets.
v7.8
Change List
7.8
Reintroduction of LMUptime Cmdlets
With the release of portal version v232, LMUptime API endpoints are fully supported. As a result, we hav reintroduced our Uptime cmdlets to help assist customers in migrating and managing uptime devices.
- New-LMUptimeDevice: Create LogicMonitor Uptime monitors (web or ping) using the v3 device endpoint.
- New-LMUptimeWebStep: Helper cmdlet to create a properly formated step for use with New-LMUptimedevice
- Get-LMUptimeDevice: Retrieve existing Uptime devices with support for filtering by type or internal/external status.
- Set-LMUptimeDevice: Update Uptime device configuration, including alert thresholds, locations, and scripted steps.
- Remove-LMUptimeDevice: Delete Uptime devices individually.
- ConvertTo-LMUptimeDevice Migration cmdlet relies will take a provided set of WebChecks/PingChecks and convert them to LMUptime Resources.
New Cmdlets
- Get-LMExternalAPIStats: Cmdlet that retrieves external API usage statistics from LogicMonitor. This provides information about API call volumes and usage patterns for external API access.
- Get-LMPortalVersion: Cmdlet that makes a lightweight API call to retrieve the portal version
from the x-server-version response header. - Get-LMRemediationSource: Retrieves remediation source information from LogicMonitor. It can return remediation sources by ID, name, display name, or using filters.
- Set-LMRemediationSource: Updates an existing remediation source in a LogicMonitor portal.
- New-LMRemediationSource: Creates a new remediation source in LogicMonitor using a provided remediation source configuration object.
- Remove-LMRemediationSource: Removes a LogicMonitor remediation source based on the specified parameters.
Fixes
- Set/New-LMAlertRule: Fixed issue that caused -ResourceProperties to not properly format the submitted Hashtable in API payload.
v7.7.5
7.7.5
Cmdlet Changes
- Get-LMDeviceData: Fixed a bug that used the incorrect pagination logic when trying to enumerate additional pages of result data.
- Get-LMDeviceData: Added a new parameter -Datapoints which allows for filtering which datapoints are returned as part of the data export.
New Cmdlets
- Set-LMDeviceGroupDatasource: This cmdlet modifies an existing device group datasource in LogicMonitor, allowing updates to monitoring state. This cmdlet provides control over the "Enable" checkbox (stopMonitoring) for a datasource applied to a device group. For alert settings use Set-LMDeviceGroupDatasourceAlertSetting.
Important Notes
- LM Uptime Removal: Due to issues with the v3 api endpoints for LM Uptime, they are being temporarily removed from the module. As soon as they are officially supported in the LM Swagger guide they will be reintroduced along with the Website->Uptime conversion cmdlet. For previous versions of the module that still have access to these cmdlets it is recommended that you wait until the official swagger endpoints are released.
v7.7.4
7.7.4
Hotfixes
- Invoke-LMCollectorDebugCommand: Fixed bug where -GroovyCommand would fail to execute when given an inline groovy snippet.
v7.7.3
7.7.3
Hotfixes
- New-LMAlertRule: Fixed bug where datapoint, instance and datasource where not properly being set due to a change in the field names.
- Set-LMAlertRule: Fixed bug where datapoint, instance and datasource where not properly being set due to a change in the field names.
v7.7.2
7.7.2
Hotfixes
- Send-LMWebhookMessage: Fixed payload formatting when sending webhook messages to LM Logs:
- JSON strings are now automatically detected and parsed into structured data, preventing escaped JSON in payloads
- Plain text messages are properly encapsulated in a
messageproperty for consistent parsing - Removed unnecessary payload wrapping that caused ingestion issues
- Resolve-LMDebugInfo: Fix bug where BearerTokens were not being obfuscated when running commands with the -Debug parameter.
#Sends multiple PSCustomObject events with additional properties merged into each payload.
$events = @(
[PSCustomObject]@{ eventType = "login"; user = "john.doe"; status = "success" }
[PSCustomObject]@{ eventType = "logout"; user = "jane.smith"; status = "success" }
)
Send-LMWebhookMessage -SourceName "AuthEvents" -Messages $events -Properties @{ source = "AD"; region = "us-east-1" }
#Sends a hashtable as a structured event and returns the result with status information.
$event = @{
eventType = "deployment"
version = "1.2.3"
environment = "production"
timestamp = (Get-Date).ToString("o")
}
Send-LMWebhookMessage -SourceName "Deployments" -Messages @($event) -PassThruv7.7.1
Change List
7.7.1
Hotfixes
- Fix bug with ConvertTo-LMUpdateDevice when trying to migrate Websites using an packet count of 50.
- Add missing parameter descriptions to 17 cmdlets.
- Automate future help/doc generation when a new release is published.
v7.7.0
Change List
7.7.0
New Cmdlets
- Get-LMRecentlyDeleted: Retrieve recycle-bin entries with optional date, resource type, and deleted-by filters.
- Restore-LMRecentlyDeleted: Batch restore recycle-bin items by recycle identifier.
- Remove-LMRecentlyDeleted: Permanently delete recycle-bin entries in bulk.
- Get-LMIntegration: Retrieve integration configurations from LogicMonitor.
- Remove-LMIntegration: Remove integrations by ID or name.
- Remove-LMEscalationChain: Remove escalation chains by ID or name.
- Invoke-LMReportExecution: Trigger on-demand execution of LogicMonitor reports with optional admin impersonation and custom email recipients.
- Get-LMReportExecutionTask: Check the status and retrieve results of previously triggered report executions.
- Invoke-LMAPIRequest: Universal API request cmdlet for advanced users to access any LogicMonitor API endpoint with custom payloads while leveraging module authentication, retry logic, and debug utilities.
- Import-LMLogicModuleFromFile: Import LogicModules using the new XML and JSON import endpoints with enhanced features including field preservation and conflict handling options. Supports datasources, configsources, eventsources, batchjobs, logsources, oids, topologysources, functions, and diagnosticsources.
Updated Cmdlets
- Update-LogicMonitorModule: Hardened for non-blocking version checks; failures are logged via
Write-Verboseand never terminate connecting cmdlets. - Export-LMDeviceData: CSV exports now expand datapoints into individual rows and JSON exports capture deeper datapoint structures.
- Set-LMWebsite: Added
alertExpralias forSSLAlertThresholdsparameter for improved API compatibility. Updated synopsis to reflect enhanced parameter validation. - New-LMWebsite: Added
alertExpralias forSSLAlertThresholdsparameter for improved API compatibility. - Format-LMFilter: Enhanced filter string escaping to properly handle special characters like parentheses, dollar signs, ampersands, and brackets in filter expressions.
- Import-LMLogicModule: Marked as deprecated with warnings. Users should migrate to
Import-LMLogicModuleFromFilefor access to newer API endpoints and features.
Bug Fixes
- Add-ObjectTypeInfo: Fixed "Cannot bind argument to parameter 'InputObject' because it is null" error by adding
[AllowNull()]attribute to handle successful but null API responses. - Resolve-LMDebugInfo: Improved HTTP method detection logic to correctly identify request types (GET, POST, PATCH, DELETE) based on cmdlet naming conventions and headers, fixing incorrect debug output.
- Invoke-LMRestMethod: Added cleanup of internal
__LMMethoddiagnostic header before dispatching requests to prevent API errors.
Examples
# Retrieve all recently deleted devices for the past seven days
Get-LMRecentlyDeleted -ResourceType device -DeletedBy "lmsupport" -Verbose
# Restore a previously deleted device and confirm the operation
Get-LMRecentlyDeleted -ResourceType device | Select-Object -First 1 -ExpandProperty id | Restore-LMRecentlyDeleted -Confirm:$false
# Permanently remove stale recycle-bin entries
Get-LMRecentlyDeleted -DeletedAfter (Get-Date).AddMonths(-1) | Select-Object -ExpandProperty id | Remove-LMRecentlyDeleted -Confirm:$false
# Export device datapoints to CSV with flattened datapoint rows
Export-LMDeviceData -DeviceId 12345 -StartDate (Get-Date).AddHours(-6) -ExportFormat csv -ExportPath "C:\\Exports"
# Retrieve all integrations
Get-LMIntegration
# Remove an integration by name
Remove-LMIntegration -Name "Slack-Integration"
# Remove an escalation chain by ID
Remove-LMEscalationChain -Id 123
# Trigger a report execution and check its status
$task = Invoke-LMReportExecution -Name "Monthly Availability" -WithAdminId 101 -ReceiveEmails "ops@example.com"
Get-LMReportExecutionTask -ReportName "Monthly Availability" -TaskId $task.taskId
# Use the universal API request cmdlet for endpoints
Invoke-LMAPIRequest -ResourcePath "/setting/integrations" -Method GET -QueryParams @{ size = 500 }
# Create a device with full control
$customData = @{
name = "1.1.1.1"
displayName = "Custom Device"
preferredCollectorId = 76
deviceType = 0
customProperties = @(
@{name="propname";value="value"}
)
}
Invoke-LMAPIRequest -ResourcePath "/device/devices" -Method POST -Data $customData -Version 3
# Import a LogicModule from file with the new endpoint
Import-LMLogicModuleFromFile -FilePath "C:\LogicModules\datasource.json" -Type datasources -Format json
# Import with conflict handling and field preservation
Import-LMLogicModuleFromFile -FilePath "C:\LogicModules\datasource.json" -Type datasources -Format json -HandleConflict FORCE_OVERWRITE -FieldsToPreserve NAME
# Import from file data variable
$fileContent = Get-Content -Path "C:\LogicModules\eventsource.xml" -Raw
Import-LMLogicModuleFromFile -File $fileContent -Type eventsources -Format xml