Skip to content

Instantly share code, notes, and snippets.

View sahammer's full-sized avatar

Sterling Hammer sahammer

View GitHub Profile
@sahammer
sahammer / Get-CFZones.ps1
Last active June 8, 2023 12:49
Simple PowerShell function to retrieve Cloudflare Zones on an account
<#
.SYNOPSIS
Quick PowerShell function to obtain your CloudFlare Zones using the v4 API
.DESCRIPTION
This function is to obtain a list of zones on your CloudFlare account
You can then use the returned id for other CloudFlare API calls.
https://api.cloudflare.com/
.PARAMETER Token
Obtain your API token here: https://support.cloudflare.com/hc/en-us/articles/200167836-Where-do-I-find-my-Cloudflare-API-key-
.PARAMETER EMail
@sahammer
sahammer / Invoke-CFPurgeCache.ps1
Last active September 12, 2021 12:24
Simple PowerShell function to purge Cloudflare Cache
<#
.SYNOPSIS
Quick PowerShell function to purge your CloudFlare Cache for a specific zone
.DESCRIPTION
This is a simple function to purge CloudFlare cache for a specific zone, can be integrated with an
Azure DevOps (or equivalent) pipeline.
.PARAMETER Token
Obtain your API token here:
https://support.cloudflare.com/hc/en-us/articles/200167836-Where-do-I-find-my-Cloudflare-API-key-
.PARAMETER EMail