You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When run Invoke-AzureRmOperationalInsightsQuery and get .Results from the object all data is returned as string. According to the official documentation the Log Analytics Search API returns the types of the different columns. The Enumerable that is returned for results should honer the data types and return them as the output of the query rather returning every column as string. This breaks any functionality to
handle the data properly like converting it to JSON or PowerShell array and make some actions by doing comparison on things like dates, integers, etc.
Script/Steps for Reproduction
Works with any query that return results with different formats like int.
$summaryQuery='Perf | take 1'$summaryQueryResults=Invoke-AzureRmOperationalInsightsQuery-Workspace $Workspace-Query $Query-Timespan (New-TimeSpan-Hours 24)
$summaryQueryResults.Results.CounterValue0$summaryQueryResults.Results.CounterValue.GetType()
IsPublic IsSerial Name BaseType
----------------------------
True True String System.Object
It should've integer or double but not string.
Module Version
Get-Module-Name AzureRM -ListAvailable
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
-------------------------------------
Script 5.4.1 AzureRM
Environment Data
$PSVersionTable
Name Value
---------
PSVersion 5.1.17134.1
PSEdition Desktop
PSCompatibleVersions {1.0,2.0,3.0,4.0...}
BuildVersion 10.0.17134.1
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Debug Output
There is no need for debug as it can be reproduced very easily.
The text was updated successfully, but these errors were encountered:
@slavizh appreciate you giving feedback on this -- definitely makes sense. I'm taking a look at modifying the cmdlet to return the values as their proper data types.
Thanks @alexeldeib . I am currently using workoaround by querying the API with my own function but as soon as the data is returned according to the LA schema I will switch back to the cmdlet.
Description
When run Invoke-AzureRmOperationalInsightsQuery and get .Results from the object all data is returned as string. According to the official documentation the Log Analytics Search API returns the types of the different columns. The Enumerable that is returned for results should honer the data types and return them as the output of the query rather returning every column as string. This breaks any functionality to
handle the data properly like converting it to JSON or PowerShell array and make some actions by doing comparison on things like dates, integers, etc.
Script/Steps for Reproduction
Works with any query that return results with different formats like int.
It should've integer or double but not string.
Module Version
Environment Data
Debug Output
There is no need for debug as it can be reproduced very easily.
The text was updated successfully, but these errors were encountered: