Skip to content

$jsonCertName and $jsonHostName are out of scope in catch block #88

@greglarkin

Description

@greglarkin

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" : {}
      }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions