Reputation: 2154
Is it possible to log to Application Insights from Powershell?
I have the log4net logging set up in Powershell already, and that is working. I also have demonstrated logging to Application Insights from a simple .Net console app using the log4net appender.
Is it a matter of grabbing the App Insights assemblies and placing them somewhere local to the Powershell script? I'm just not sure what to try next.
Any ideas?
Upvotes: 4
Views: 1010
Reputation: 25126
This should be possible, the same way as you call any .NET assembly / c# code from powershell. All you need is the "core" app insights assembly/assemblies from the core nuget package, and then use TelemetryClient.TrackEvent
etc as normal.
Upvotes: 1