Skip to content

Instantly share code, notes, and snippets.

View tyconsulting's full-sized avatar
💭
Working Hard

Tao Yang tyconsulting

💭
Working Hard
View GitHub Profile
@tyconsulting
tyconsulting / Import-MouduleFromPSRepoToAAAccount.ps1
Created February 12, 2017 10:03
PowerShell script to deploy / update PowerShell modules from a PS Repository to Azure Automation Account
#Requires -Modules AzureRM.Automation, AzureRM.Profile, PowerShellGet
#Requires -version 5.0
<#
=============================================================================================
AUTHOR: Tao Yang
DATE: 12/02/2017
Version: 1.0
Comment: deploy / update PowerShell modules from a PS Repository to Azure Automation Account
=============================================================================================
#>
#requires -Version 5.0 -Modules AzureRM.OperationalInsights, AzureRM.profile
<#
============================================================================================================================
AUTHOR: Tao Yang
DATE: 17-12-2016
Version: 1.0
Comment:
- Create OMS saved searches to that map SCOM ACS reports that are
- Listed in Wei Hao Lim's blog post:
- https://blogs.msdn.microsoft.com/wei_out_there_with_system_center/2016/07/25/mapping-acs-reports-to-oms-search-queries/
#requires -Version 2.0 -Modules OMSDataInjection
<#
========================================================================
AUTHOR: Tao Yang
DATE: 02/11/2016
Version: 1.0
Comment:
Azure Automation Runbook that reads Windows Event export (evt) files
and inject events to OMS Log Analytics.
@tyconsulting
tyconsulting / AzureTableEntityModuleCodeExamples.ps1
Created November 30, 2016 01:32
Sample code for using AzureTableEntity PowerShell module
<#
================================================================================
AUTHOR: Tao Yang
DATE: 30/11/2016
Version: 1.0
Comment: Sample code for using AzureTableEntity PowerShell module
Project Repo: https://github.com/tyconsulting/AzureTableEntity-PowerShell-Module
================================================================================
#>
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using System.IO;
using System.Text;
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{
log.Info($"C# HTTP trigger proxy function processed a request. RequestUri={req.RequestUri}");
$requestBody = Get-Content $req -Raw | ConvertFrom-Json
$subscriptionId = $requestBody.subscriptionid
if ($req_query_subscriptionid)
{
$subscriptionId = $req_query_subscriptionid
}
if ($subscriptionId -eq $null)
{