Skip to content

Instantly share code, notes, and snippets.

View Maahaax's full-sized avatar

Maximilian Maahaax

View GitHub Profile
#requires -version 4
<#
.SYNOPSIS
Gets the current Let's Encrypt certificate by domain from the given opnSense-Firewall via SCP.
.DESCRIPTION
Sync-Cert connects to the given opnSense-Router via SCP. It pulls the Let's encrypt certificate and key for the given domain name, based on the common name
into the local working directory. Afterwards it uses OpenSSL to convert the .cer and .key files to create a new .pfx file which can be used in Exchange and IIS.
.PARAMETER Domain
Domain of the certificate to get from the firewall
.PARAMETER Router