Skip to content

Instantly share code, notes, and snippets.

Login-AzureRmAccount -Credential $Creds
$Params = @{"Param1" = "Value1";"Param2" = "Value2"}
$job = Start-AzureRmAutomationRunbook -Name $Name -ResourceGroupName $ResourceGroupName -AutomationAccountName $AutomationAccountName -Parameters @params
Error:
"Start-AzureRmAutomationRunbook : Missing an argument for parameter 'Parameters'. Specify a parameter of type 'System.Collections.I
Dictionary' and try again."
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {
},
"resources": [
{
"type": "Microsoft.Compute/availabilitySets",
"name": "{{ avset_name }}",
@trondhindenes
trondhindenes / ConfigureRubyOnRails.sh
Last active October 22, 2015 15:13
Configure Ruby + Rails
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev -y
sudo apt-get install libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev -y
sudo apt-get install libcurl4-openssl-dev python-software-properties libffi-dev -y
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev -y
#Note that this key may changes
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
#if this command fails, you should get a message containing the correct gpg command to run instead of the above
@trondhindenes
trondhindenes / createpicturetable.vba
Created November 19, 2015 10:16
Create word table and auto-fill images
'Create the following Word Macro:
Sub InsertMultipleImages()
Dim fd As FileDialog
Dim oTable As Table
Dim sNoDoc As String
Dim vrtSelectedItem As Variant
Dim Counter As Integer
If Documents.Count = 0 Then
sNoDoc = MsgBox(" " & _
"No document open!" & vbCr & vbCr & _
@trondhindenes
trondhindenes / errortest.ps1
Last active December 28, 2015 19:03
ErrorWeirdness
Function Inner
{
[CmdletBinding()]
Param ()
Try
{
throw "Inner exception"
}
Catch
#Module PowerShellGet
#File PSModule.psm1
#Bug causes publish-module to fail if user has a profile with spaces in it ("C:\users\sam smith")
#Replace line 6817 with the following:
Microsoft.PowerShell.Management\Start-Process -FilePath "$script:NuGetExePath" `
-ArgumentList ('push "' + $NupkgPath + '"' + " -source $Destination -NonInteractive -ApiKey $NugetApiKey") `
-RedirectStandardError $tempErrorFile `
-RedirectStandardOutput $tempOutputFile `
-NoNewWindow `
-Wait
#!powershell
# <COPYRIGHT>
# <CODEGENMETA>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#!/usr/bin/python
# -*- coding: utf-8 -*-
# <COPYRIGHT>
# <CODEGENMETA>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
sudo apt-get update
sudo apt-get install git python-setuptools python-dev sshpass libffi-dev libssl-dev make libxml2-dev libxslt1-dev acl build-essential -y
sudo easy_install pip
sudo pip install paramiko PyYAML jinja2 httplib2 requests lxml cssselect xmltodict sphinx
sudo pip install pywinrm
sudo pip install requests==2.13.0
sudo pip install packaging
#In order to build docs:
sudo apt-get install asciidoc -y
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Net;
public static void Run(string myEventHubMessage, TraceWriter log)
{
String data = myEventHubMessage;
log.Info($"C# Event Hub trigger function processed a message: {data}");
data = data.Replace("http://schemas.microsoft.com", "");