Application Insights for PowerShell scripts and Modules
Only tested on PowerShell 5
The following sample scripts are available to get you started:
Demonstration of the Exception Logging capabilities of Application Insights
Start collection perfromance counters and send them to App Insights
Sample of helper functions and extended tracing
- install psake (Build Automation Tool)
Install-Module -Name psake
- install pester (PS Unit Test Tool)
Install-Module -Name Pester -Force -SkipPublisherCheck
- install CredentialManager
Install-Module -Name CredentialManager
As seen above, Unit Tests are executed using Pester.
You also need Fiddler installed on your system, this can be done using chocolatey:
choco install fiddler
A fiddler script is added automatically. A backup of your current script is created, as it gets overwritten from \Fiddler2\Scripts The script adds a new Fiddler QuickExec command "dumpjson" to be able to retrieve the captured data in JSON format for PowerShell consumption.