param($result)
if ($result.IsSuccess) {
   $pfxdir = Split-Path -parent $result.ManagedItem.CertificatePath
   $outputpfx = $pfxdir + "\" + $result.ManagedItem.RequestConfig.PrimaryDomain+".pfx" 
   Copy-Item $result.ManagedItem.CertificatePath -Destination $outputpfx
}