In the windows.ps1 task, if the agent installation fails and control is transferred to the catch block, the $jsonCertName and $jsonHostName variables are out of scope and display blank values.
Sample output:
{
"status" : "failure",
"host" : "",
"certname" : "",
"master" : "puppet.classroom.puppet.com",
"_error" : {
"msg" : "Unable to install agent on with certname : Exception calling \"DownloadString\" with \"1\" argument(s): \"The request was aborted: Could not create SSL/TLS secure channel.\"",
"kind": "powershell_error",
"details" : {}
}
}