PowerShell module that enables running KQL (Kusto Query Language) queries directly from PowerShell
Install-Module -Name KQL -Scope CurrentUser
Invoke-KQL 'StormEvents | take 2'
- Due to nuget compatibility issues, the module is running only on Windows PowerShell at the moment
- For the same reasons, it supports only implicit authentication (i.e. on user behalf)
# Use Verbose flag
Invoke-KQL 'StormEvents | project StartTime, State, EventNarrative | take 5' -Verbose
# Use alternate database
Invoke-KQL -Database 'https://help.kusto.windows.net/SampleLogs' -Query 'RawSysLogs | summarize count() by name'
# Use Invoke-KQL inside standard PowerShell pipeline
'StormEvents', 'Covid19_Bing' | % {Invoke-KQL "$_ | count"}
# Use multiple queries in one command
'StormEvents', 'Covid19_Bing' | % {"$_ | count"} | Invoke-KQL
# Run Kusto commands
Invoke-KQL '.show tables'