Convert certificate built-in step to coded step template

Is there a way to convert the built-in certification install template into a coded template? I did see I could convert to step template but the certificate values just ended up in with a built-in Action and Action properties.

The reason I am trying to do this is I have a large environment and a separate file per tenant that I need to filter and only install tenant specific certificates on machines that are for that particular tenant. I would like to simply built on the same logic that is installing it now while simply adding the filter code (PowerShell) to the beginning of the call.

Thanks,
Dave Schmitz

Hi Dave,

Thanks for getting in touch! Unfortunately the source code behind the built-in steps isn’t exposed or customizable. However based on how I understand what you’re after, I would guess that the best and easiest solution would be to utilize tenant variables to control which certificate applies to each tenant. We have a doc page covering tenant specific variables at the following link in case it helps.

Alternatively, there are some community-written step templates in our library which are customizable and you can reference each template’s source code. Maybe there would be one there that might provide what you’re after?

I hope this helps, and please don’t hesitate to reach out with any other questions moving forward!

Best regards,

Kenny

Kenny,

Thank you for the suggestions. I am currently using tenant-specific variables to control tenant-specific certificates. The hurdle I’m trying to work around is we are trying not to tag each machine in the environment with tenant tags but machine 1 may have tenant A, B, & C while machine 2 might have tenant C, D, & E. The other way I might get around this is through a pre-step to determine if the certificate step should run on a given machine. My original hope was just to extend the existing certificate piece with machine check.

Thanks,
Dave

@Kenneth_Bates,

Is there a way that I can use the expanded certificate properties along with Import-PfxCertificate to create my own PowerShell install?

Thanks,
Dave Schmitz

Hi Dave,

Thanks for following up and expanding a bit on your scenario! My apologies for the delay in getting back to you here.

Your comment to have a pre-step to determine if the certificate step should run on a given machine makes me think that perhaps a solution might be to store the result of this check into an output variable, then define a run condition on the certificate step to control whether or not it runs based on the value of that variable. Or tie the run condition to a prompted variable where the value would be supplied at deployment time?

If you have your certificate defined as a certificate variable in your project, that variable will be expanded into those properties you referred to, which you can use in your PowerShell script.

Lastly, the following community-written step templates can be found in the following links. You can view the source code of those steps, and maybe those will be helpful to reference?

I hope this helps! Please let me know how you go or if you have any further questions. :slight_smile:

Best regards,

Kenny

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.