Skip to content

Instantly share code, notes, and snippets.

View naamancampbell's full-sized avatar

Naaman Campbell naamancampbell

  • Brisbane, Australia
View GitHub Profile
@naamancampbell
naamancampbell / .env_lambda.ps1
Last active January 2, 2018 08:31
Reads PowerShell environment variables file to upload to AWS Lambda
<#
.SYNOPSIS
Reads PowerShell environment variables file to upload to AWS Lambda
.DESCRIPTION
The .env_lambda script is made of the following steps:
1. Skips the first three lines of the .env file
2. Retrieves the contents of each line after the first ":"
3. Joins all variables into a comma-separated string
4. Uploads variables up to AWS Lambda
@naamancampbell
naamancampbell / Disable-UAC.ps1
Created October 21, 2017 11:26
Disables UAC without privilege escalation. NB. Must run from another host (mgmt).
##########
## 1. Save file on mgmt host.
## - change 'COMPUTERNAME' to target hostname
##########
Configuration Disable-UAC {
Import-DscResource -ModuleName PsDesiredStateConfiguration
Import-DscResource -ModuleName xSystemSecurity -Name xUac
@naamancampbell
naamancampbell / acmecert.ps1
Last active October 17, 2017 11:41
Automatically provisions new Lets Encrypt SSL certificate (using AWS Route 53 DNS verification) and adds to Windows Local Machine certificate store. Route 53 IAM Role required.
###
# References:
# - https://github.com/RobBiddle/ACMESharpRoute53Automation
# - https://github.com/ebekker/ACMESharp/wiki/Quick-Start
# - https://pkisharp.github.io/ACMESharp-docs/Quick-Start
# - https://www.frankysweb.de/exchange-2016-lets-encrypt-zertifikat-erneuern/
###
$BaseDomain = "clancampbell.id.au"
$FedServiceName = "sts.$BaseDomain"