This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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 }}", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!powershell | |
# This file is part of Ansible. | |
# | |
# Copyright 2015, Trond Hindenes <trond@hindenes.com> | |
# | |
# 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. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!powershell | |
# This file is part of Ansible. | |
# | |
# Copyright 2015, Trond Hindenes <trond@hindenes.com> | |
# | |
# 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. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Exit-Json($obj) | |
{ | |
# If the provided $obj is undefined, define one to be nice | |
If (-not $obj.GetType) | |
{ | |
$obj = New-Object psobject | |
} | |
echo $obj | ConvertTo-Json -Compress -Depth 99 | |
Exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Unzip-File { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$true, | |
ValueFromPipeline=$true)] | |
[ValidateScript({ | |
If ((Test-Path -Path $_ -PathType Leaf) -and ($_ -like "*.zip")) { | |
$true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-StrictMode -Version 2 | |
$params = "" | Select Firstname, Lastname, ensure | |
$params.Lastname = "Hindenes" | |
$params.Ensure = "present" | |
$returnobj = "" | |
. "D:\trond.hindenes\Documents\Scripts\Ansible\fork\trondhindenes\ansible\lib\ansible\module_utils\powershell.ps1" | |
#simple - should succeed | |
Get-AnsibleParam -obj $params -name Firstname | |
#Use alias |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Release when less than 4 moves are in progress | |
Function WaitForMoves | |
{ | |
Do { | |
$moves = Get-moverequest | Get-moverequeststatistics | where {$_.StatusDetail -ne "COmpleted"} | |
if (($moves.count) -gt 3) | |
{ | |
$movescount = $moves.count | |
Write-Progress -Activity "Moving $movescount" -Status "Moving $movescount" -PercentComplete 100 | |
Start-sleep -seconds 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://care.dlservice.microsoft.com/dl/download/7/3/C/73C250BE-67C4-440B-A69B-D0E8EE77F01C/10514.0.150808-1529.TH2_RELEASE_SERVER_OEMRET_X64FRE_EN-US.ISO |