Skip to content

Instantly share code, notes, and snippets.

View stopthatastronaut's full-sized avatar

Jason Brown stopthatastronaut

View GitHub Profile
# gets past a problem in Invoke-WebRequest which causes issues with UTF-8 Responses (such as those from raw.githubusercontent.com)
Function Invoke-UTF8WebRequest
{
# based loosely on https://gist.github.com/angel-vladov/9482676
param($uri)
[Net.HttpWebRequest]$req = [Net.WebRequest]::Create($Uri)
[Net.HttpWebResponse]$res = $req.GetResponse()
$sr = [IO.StreamReader]::new($res.GetResponseStream())
$body = $sr.ReadToEnd()
@stopthatastronaut
stopthatastronaut / Get-R53ResourceRecordList
Created May 25, 2017 02:12
Get-R53ResourceRecordList
# Gets all Route53 DNS records for the requested Zone
Function Get-R53ResourceRecordList
{
[CmdletBinding()]
param
(
[ValidateScript(
{
$_ -like "*."