Nice work!
You could probably skip the part where you search for the cert by subject as the Post Request powershell params will include details of the cert hashes (new and previous) by default in $result.ManagedItem.CertificateThumbprintHash
and $result.ManagedItem.CertificatePreviousThumbprintHash
. I will update the docs.at https://docs.certifytheweb.com/docs/script-hooks.html to make this clearer.
In the future we’d like to provide a UI that will allow you to specify additional parameters for pre-post request scripts (so this example the config for the RS app name/service name), so that scripts can be a little more general purpose.