PowerShell does not have overload method of TrackEvent() in Microsoft.ApplicationInsights.TelemetryClient
Issue Transfer
This issue has been transferred from the Azure SDK for .NET repository, #33904.
Please be aware that @MarsWangyang is the author of the original issue and include them for any questions or replies.
Details
Hi all,
I was trying to use Microsoft.ApplicationInsights.TelemetryClient to send custom event to Application Insights via PowerShell. I did find TrackEvent() has overload method which might could send custom measurements. However, it said Cannot find an overload for "TrackMetric" and the argument count: "3".
this is my code
$client = [Microsoft.ApplicationInsights.TelemetryClient]::new()
$p = [pscustomobject]@{
Str = "String Test"
} | ConvertTo-Json
$measurement = [pscustomobject]@{
totalTime = 0.33
} | ConvertTo-Json
$client.TrackEvent("Test Message", $p, $measurement);
Is there anyone know how to send the custom measurements data to the application insight?
Tks.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 61c28aeb-55c8-b340-f9d1-dcbdd3404bde
- Version Independent ID: 1ff4149b-f85c-a9d7-c8b0-cbb2c5357af2
- Content: TelemetryClient.TrackEvent Method (Microsoft.ApplicationInsights) - Azure for .NET Developers
- Content Source: xml/Microsoft.ApplicationInsights/TelemetryClient.xml
- Service: application-insights
- GitHub Login: @rloutlaw
- Microsoft Alias: routlaw
following the newest response
This issue is stale because it has been open 300 days with no activity. Remove stale label or this will be closed in 7 days. Commenting will instruct the bot to automatically remove the label.
Any update?