Skip to content

Instantly share code, notes, and snippets.

@maskati
maskati / #applicationinsights-stream-live-metrics.md
Last active August 8, 2023 13:01
Stream Application Insights live metrics to a local PowerShell grid view

This PowerShell script streams Application Insights live metric traces to your local system and displays them in a PowerShell grid view. This is useful since the Azure Portal trace viewing experience is somewhat limited.

Warning

This script uses undocumented functionality. Exercise caution when running any scripts against your infrastructure.

To use:

  1. Ensure you are logged in using Azure CLI and have selected the relevant subscription.
  2. Run the script in a PowerShell terminal (tested only with PowerShell 7.3).
  3. Select the relevant Application Insights resource from the first grid view. This lists all Application Insights resources in the Azure CL
@chrisjlee
chrisjlee / querySelector.polyfill.js
Created February 12, 2014 17:39
IE document.querySelector() polyfill
if (!document.querySelectorAll) {
document.querySelectorAll = function (selectors) {
var style = document.createElement('style'), elements = [], element;
document.documentElement.firstChild.appendChild(style);
document._qsa = [];
style.styleSheet.cssText = selectors + '{x-qsa:expression(document._qsa && document._qsa.push(this))}';
window.scrollBy(0, 0);
style.parentNode.removeChild(style);