Build Status | Branch |
---|---|
master | |
dev |
- What is ALTools
- Installation
- How to Create Azure Log Worksapce
- How to Retrieve required information from existing Workspace
- Run Examples
ALTools
is a simple micro-module to interact with Azure Logs.
It is based on official Microsoft documentation.
In it's current state it is used to send custom PSObjects to Azure Logs.
ALTools
module is available on PowerShell Gallery so installation is quite easy:
Install-Module ALTools
To send PowerShell Objects
to Azure Logs you will first need to get WorkspaceID and PrimaryKey. Use this to get it.
Here are some examples of how to use this to send custom logs to Azure Logs
Send all files from given path Azure Logs:
Import-Module ALTools -Force
$invocationStartTime = [DateTime]::UtcNow
$object = Get-Process
$invocationEndTime = [DateTime]::UtcNow
$writeToLogAnalyticsSplat = @{
ALWorkspaceID = 'e2920363-xxxx-xxxx-xxxx-740exxxx801'
invocationStartTime = $invocationStartTime
PSObject = $object
ALTableIdentifier = 'ALTools' #Your name for Azure Logs
invocationEndTime = $invocationEndTime
WorkspacePrimaryKey = 'I5ZBxxxxxxxxxxxRkiy8uZ77rfTKKvzeI+g=='
}
Write-ToLogAnalytics @writeToLogAnalyticsSplat -Verbose
Send all current running processes to Azure Logs:
$invocationStartTime = [DateTime]::UtcNow
$object = Get-ChildItem -Path 'C:\AdminTools'
$invocationEndTime = [DateTime]::UtcNow
$writeToLogAnalyticsSplat = @{
ALWorkspaceID = 'e2920363-xxxx-xxxx-xxxx-740exxxx801'
invocationStartTime = $invocationStartTime
PSObject = $object
ALTableIdentifier = 'ALTools' #Your name for Azure Logs
invocationEndTime = $invocationEndTime
WorkspacePrimaryKey = 'I5ZBxxxxxxxxxxxRkiy8uZ77rfTKKvzeI+g=='
}
Write-ToLogAnalytics @writeToLogAnalyticsSplat -Verbose