@webprofusion thank you for the suggestion.
Here it is the updated code.
I deleted the code in the previous post so it’s not confusing.
param($result)
$latest = $result.ManagedItem.CertificatePath
openssl pkcs12 -in $latest -passin pass: -out C:\path\to\apache\ssl.key\public.key -nocerts -nodes
openssl pkcs12 -in $latest -out C:\path\to\apache\ssl.crt\public.crt -nokeys -passin pass:
Restart-Service -Name Apache2.4 -Force
save it to a .ps1 file and adapt to you environment
P.S. You need to set the path enviroment variable for openssl in windows or run it from the openssl directory