Skip to content

Instantly share code, notes, and snippets.

package main
import (
"context"
"fmt"
"net"
"os/exec"
"strconv"
"strings"
"sync"
@blinksmith
blinksmith / cf-update-dns-txt.ps1
Created July 15, 2019 10:45 — forked from charlesroper/cf-update-dns-txt.ps1
PowerShell script to update the _acme-challenge TXT entry on CloudFlare
# See https://github.com/ebekker/ACMESharp/wiki/Quick-Start for background
# Could be enhanced by putting YOUR_CF_API_KEY and YOUR_EMAIL in environment vars
# Usage:
# > cf-update-dns-txt.ps1 -Domain example.com -Value vNx_fpLgvq0l4rqSATuxhxl9pa155SoeKvNZ98AFB_4
param( [string]$domain, [string]$value )
$headers = @{
"X-Auth-Key" = "YOUR_CF_API_KEY"
"X-Auth-Email" = "YOUR_EMAIL"
"Content-Type" = "application/json"
##
# WHOIS servers for new TLDs (http://www.iana.org/domains/root/db)
# Current as of 2015-09-12
##
\.abbott$ whois.afilias-srs.net
\.abogado$ whois-dub.mm-registry.com
\.ac$ whois.nic.ac
\.academy$ whois.donuts.co
\.accountant$ whois.nic.accountant
# Show message box popup.
Add-Type -AssemblyName System.Windows.Forms
$result = [System.Windows.Forms.MessageBox]::Show("My message", "Window Title", [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::None)
# Show input box popup.
Add-Type -AssemblyName Microsoft.VisualBasic
$inputText = [Microsoft.VisualBasic.Interaction]::InputBox("Enter some value:", "Window Title", "Default value")
# Show an Open File Dialog and return the file selected by the user.
function Read-OpenFileDialog([string]$InitialDirectory, [switch]$AllowMultiSelect)