List of Script Variables

Hi

Looking for a complete list of scripting variables
I have seen this https://docs.certifytheweb.com/docs/script-hooks.html link.
But I am specifically looking for the DisplayName variable

I couldn’t find anything myself, so I fed the $result variable to a function that recursively printed all of the properties.

I’m going to guess that $_.ManagedItem.Name is what you’re looking for.

$_.Abort
$_.Actions
$_.ChallengeResponsePropagationSeconds
$_.IsSuccess
$_.ManagedItem
$_.Message
$_.Result
$_.ManagedItem.CertificateId
$_.ManagedItem.CertificatePath
$_.ManagedItem.CertificatePreviousThumbprintHash
$_.ManagedItem.CertificateRevoked
$_.ManagedItem.CertificateThumbprintHash
$_.ManagedItem.Comments
$_.ManagedItem.CurrentOrderUri
$_.ManagedItem.DateExpiry
$_.ManagedItem.DateLastRenewalAttempt
$_.ManagedItem.DateRenewed
$_.ManagedItem.DateStart
$_.ManagedItem.Deleted
$_.ManagedItem.DomainOptions
$_.ManagedItem.GroupId
$_.ManagedItem.Health
$_.ManagedItem.Id
$_.ManagedItem.IncludeInAutoRenew
$_.ManagedItem.InstanceId
$_.ManagedItem.IsChanged
$_.ManagedItem.ItemType
$_.ManagedItem.LastRenewalStatus
$_.ManagedItem.Name
$_.ManagedItem.ParentId
$_.ManagedItem.RenewalFailureCount
$_.ManagedItem.RenewalFailureMessage
$_.ManagedItem.RequestConfig
$_.ManagedItem.ServerSiteId
$_.ManagedItem.TargetHost
$_.ManagedItem.DateExpiry
	{.NET DateTime object sub-properties...}
$_.ManagedItem.DateLastRenewalAttempt
	{.NET DateTime object sub-properties...}
$_.ManagedItem.DateRenewed
	{.NET DateTime object sub-properties...}
$_.ManagedItem.DateStart
	{.NET DateTime object sub-properties...}
$_.ManagedItem.DomainOptions.Domain
$_.ManagedItem.DomainOptions.IsChanged
$_.ManagedItem.DomainOptions.IsManualEntry
$_.ManagedItem.DomainOptions.IsPrimaryDomain
$_.ManagedItem.DomainOptions.IsSelected
$_.ManagedItem.DomainOptions.Title
$_.ManagedItem.Health.value__
$_.ManagedItem.ItemType.value__
$_.ManagedItem.LastRenewalStatus.value__
$_.ManagedItem.RequestConfig.AlwaysRecreateBindings
$_.ManagedItem.RequestConfig.BindingIPAddress
$_.ManagedItem.RequestConfig.BindingPort
$_.ManagedItem.RequestConfig.BindingUseSNI
$_.ManagedItem.RequestConfig.Challenges
$_.ManagedItem.RequestConfig.ChallengeType
$_.ManagedItem.RequestConfig.CSRKeyAlg
$_.ManagedItem.RequestConfig.DeploymentBindingBlankHostname
$_.ManagedItem.RequestConfig.DeploymentBindingMatchHostname
$_.ManagedItem.RequestConfig.DeploymentBindingOption
$_.ManagedItem.RequestConfig.DeploymentBindingReplacePrevious
$_.ManagedItem.RequestConfig.DeploymentSiteOption
$_.ManagedItem.RequestConfig.EnableFailureNotifications
$_.ManagedItem.RequestConfig.IsChanged
$_.ManagedItem.RequestConfig.PerformAutoConfig
$_.ManagedItem.RequestConfig.PerformAutomatedCertBinding
$_.ManagedItem.RequestConfig.PerformChallengeFileCopy
$_.ManagedItem.RequestConfig.PerformExtensionlessConfigChecks
$_.ManagedItem.RequestConfig.PerformTlsSniBindingConfigChecks
$_.ManagedItem.RequestConfig.PostRequestPowerShellScript
$_.ManagedItem.RequestConfig.PreRequestPowerShellScript
$_.ManagedItem.RequestConfig.PrimaryDomain
$_.ManagedItem.RequestConfig.SubjectAlternativeNames
$_.ManagedItem.RequestConfig.WebhookContentBody
$_.ManagedItem.RequestConfig.WebhookContentType
$_.ManagedItem.RequestConfig.WebhookMethod
$_.ManagedItem.RequestConfig.WebhookTrigger
$_.ManagedItem.RequestConfig.WebhookUrl
$_.ManagedItem.RequestConfig.WebsiteRootPath
$_.ManagedItem.RequestConfig.Challenges.ChallengeCredentialKey
$_.ManagedItem.RequestConfig.Challenges.ChallengeProvider
$_.ManagedItem.RequestConfig.Challenges.ChallengeRootPath
$_.ManagedItem.RequestConfig.Challenges.ChallengeType
$_.ManagedItem.RequestConfig.Challenges.DomainMatch
$_.ManagedItem.RequestConfig.Challenges.IsChanged
$_.ManagedItem.RequestConfig.Challenges.Parameters
$_.ManagedItem.RequestConfig.Challenges.ZoneId
$_.ManagedItem.RequestConfig.DeploymentBindingOption.value__
$_.ManagedItem.RequestConfig.DeploymentSiteOption.value__
1 Like

Hi, yes you’re correct - we don’t currently have a document for this other than the source code itself: https://github.com/webprofusion/certify/blob/development/src/Certify.Models/Config/ManagedCertificate.cs

This will change somewhat between versions (especially between major version) and but the core information is generally the same.

Thanks
This is what I was looking for.

Just as a note to myself, here is basic example Powershell script which also outputs the result as JSON, this illustrates all of the values available in the result object as well as testing the script runs normally:

param($result)  
$logpath = "c:\temp\ps-test.txt"

$date = Get-Date

Add-Content $logpath ("-------------------------------------------------");
Add-Content $logpath ("Script Run Date: " + $date)
Add-Content $logpath ($result | ConvertTo-Json)

Hi guys,

In my scenario I export certificate (crt) and key to a destination path with 2 separate Deployment Tasks.
I’m looking for $result params in oder to rename them: is ManagedItem.CertificatePath good for both certificate and key file name?

Thanks

I’m not sure this is applicable. In the Deployment Task, you’re supposed to explicitly give it a full path and filename. I doubt they are passed in the PowerShell variable as they were not part of the original request. (All Deployment Tasks are peers including PowerShell and act upon the finished request) But you explicitly set the path/filename, so you already know where they are.

If you are using scripting for your tasks you can do what you like - the CertificatePath is a full path to the locally stored PFX so it’s not particulary relevant elsewhere, if you are dynamically scripting a file export I’d probably use the primary domain ($result.ManagedItem.RequestConfig.PrimaryDomain), note that you have to replace * if saving a file name otherwise the filename would be an invalid, conventionally that’s replaced with _.

If you are purely using the export Deployment Tasks and not scripting anything yourself then there is currently no dynamic naming and you have to set the destination filename in the task settings (except for the CCS Export task which expects a folder and outputs a file per domain).

Hi guys,

thanks for replying me.
I assumed that Destination File Path field on Deplyoment task was for path only and not also for file name…
I will give it a try

1 Like