Skip to content

Instantly share code, notes, and snippets.

View davidobrien1985's full-sized avatar

David O'Brien davidobrien1985

View GitHub Profile
---
driver:
name: vagrant
provisioner:
name: chef_zero
platforms:
- name: win-2012r2-x64-nocm-wmf5
driver_config:
@davidobrien1985
davidobrien1985 / BundleConfig.ps1
Created May 12, 2016 20:56
Packer template that's supposed to, but doesn't sysprep.
$EC2SettingsFile="C:\\Program Files\\Amazon\\Ec2ConfigService\\Settings\\BundleConfig.xml"
$xml = [xml](get-content $EC2SettingsFile)
$xmlElement = $xml.get_DocumentElement()
foreach ($element in $xmlElement.Property)
{
if ($element.Name -eq "AutoSysprep")
{
$element.Value="Yes"
}
param (
[string]$domainName,
[string]$AD1NetBIOSName,
[string]$safemodepassword,
[string]$DomainAdminPassword,
[string]$ADServer1PrivateIp
)
Function New-DscCert {
[CmdletBinding()]
@davidobrien1985
davidobrien1985 / prepare-azurermforpacker.ps1
Created June 21, 2016 12:46
This gist prepares Azure for use with Packer.
param (
[string]$azurelocation = 'Australia Southeast',
[string]$app_password = 'P@ssw0rd',
[string]$subscription_ID
)
Add-AzureRmAccount
$azuresub = Get-AzureRmSubscription -SubscriptionId $subscription_ID
@davidobrien1985
davidobrien1985 / icao_weather.ps1
Created July 19, 2016 14:05
Azure Functions example
$res = Invoke-RestMethod -Method Get -Uri "http://avwx.rest/api/metar.php?station=$req_query_icao&format=JSON" -verbose
$res = $res.'Raw-Report'
Out-File -Encoding Ascii $response -inputObject "$res"
@davidobrien1985
davidobrien1985 / packer.json
Created December 2, 2016 01:18
packer.json
{
"variables": {
"aws_source_ami": "ami-3859605b",
"aws_instance_type": "t2.medium",
"aws_instance_profile": "",
"aws_vpc_id": "",
"aws_subnet_id": "",
"aws_region": "ap-southeast-2",
"soe_version": "",
"build_number": ""
==> amazon-ebs: Provisioning with Powershell...
==> amazon-ebs: Provisioning with shell script: C:\dev\git\versent\ref-remotedesktopservices\packer/scripts/install_rds_webaccess.ps1
2016/12/02 12:16:12 ui: ==> amazon-ebs: Provisioning with shell script: C:\dev\git\versent\ref-remotedesktopservices\packer/scripts/install_rds_webaccess.ps1
2016/12/02 12:16:12 packer.exe: 2016/12/02 12:16:12 Opening C:\dev\git\versent\ref-remotedesktopservices\packer/scripts/install_rds_webaccess.ps1 for reading
2016/12/02 12:16:12 packer.exe: 2016/12/02 12:16:12 [INFO] 1110 bytes written for 'uploadData'
2016/12/02 12:16:12 [INFO] 1110 bytes written for 'uploadData'
2016/12/02 12:16:12 packer.exe: 2016/12/02 12:16:12 Uploading file to 'c:/Windows/Temp/script.ps1'
2016/12/02 12:16:14 packer.exe: #< CLIXML
2016/12/02 12:16:15 packer.exe: <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><Obj S="progress" RefId="0"><TN RefId="0"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></T
$ErrorActionPreference = 'Stop'
$VerbosePreference = 'Continue'
$deployPath = 'C:\Program Files\RDS_Core\WebAccess'
# Set up the DSC folder structure
$dscPath = Join-Path $deployPath 'DSC'
New-Item -Path $dscPath -ItemType Directory -Force
# Install RDS connection broker components
using System;
using System.IO;
using System.Net;
using Newtonsoft.Json.Linq;
public class LicensingHelper
{
public static JArray GetO365Skus(double apiVersion, string apiToken)
{
var uri = $"https://graph.windows.net/myorganization/subscribedSkus?api-version={apiVersion}";
Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling .NET Web Application deployment.
MSBuild auto-detection: using msbuild version '14.0' from 'D:\Program Files (x86)\MSBuild\14.0\bin'.
All packages listed in packages.config are already installed.
D:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1819,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Azure.KeyVault.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\home\site\repository\o365_compiled\o365_compiled.csproj]
D:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1819,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Azure.WebJobs, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitectur