Skip to content

Instantly share code, notes, and snippets.

💭
Working Hard

Tao Yang tyconsulting

💭
Working Hard
Block or report user

Report or block tyconsulting

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tyconsulting
tyconsulting / Import-MouduleFromPSRepoToAAAccount.ps1
Created Feb 12, 2017
PowerShell script to deploy / update PowerShell modules from a PS Repository to Azure Automation Account
View Import-MouduleFromPSRepoToAAAccount.ps1
#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
=============================================================================================
#>
View Create-ACSSavedSearches.ps1
#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/
View Publish-EvtToOMS.ps1
#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 Nov 30, 2016
Sample code for using AzureTableEntity PowerShell module
View AzureTableEntityModuleCodeExamples.ps1
<#
================================================================================
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
================================================================================
#>
View HTTPTriggerProxy.csx
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}");
View GetAzureVMs.ps1
$requestBody = Get-Content $req -Raw | ConvertFrom-Json
$subscriptionId = $requestBody.subscriptionid
if ($req_query_subscriptionid)
{
$subscriptionId = $req_query_subscriptionid
}
if ($subscriptionId -eq $null)
{
You can’t perform that action at this time.