Skip to content

Instantly share code, notes, and snippets.

View davidobrien1985's full-sized avatar

David O'Brien davidobrien1985

View GitHub Profile
@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 / 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
param (
[string]$domainName,
[string]$AD1NetBIOSName,
[string]$safemodepassword,
[string]$DomainAdminPassword,
[string]$ADServer1PrivateIp
)
Function New-DscCert {
[CmdletBinding()]
@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"
}
---
driver:
name: vagrant
provisioner:
name: chef_zero
platforms:
- name: win-2012r2-x64-nocm-wmf5
driver_config: