title: Azure Runbook Webhook with parameters from httpClient
body: <p>looked at a few examples of how to execute a webhook with parameters but can't seem to make the connection on what I am missing. Any advice on what I am doing wrong would be appreciated. </p>
  
  <p>please consider: 
  my Powershell runbook</p>
  
  <pre><code>[CmdletBinding()]
  Param([object]$WebhookData) #this parameter name needs to be called 
  WebHookData otherwise the webhook does not work as expected.
  
  $VerbosePreference = 'continue'
  Write-Output "hello"
      "in the inline"
      if($WebhookData -ne $null) 
          {
              "using webhookdata"
              $WebhookName =  $WebhookData.WebhookName
              $WebhookBody =  $WebhookData.RequestBody
              $webhookBodyObject = $WebhookBody | ConvertFrom-JSON
  
  
  line 15            'The parameter created was ' $webhookBodyObject.strYear
  </code></pre>
  
  <p>My httpclient post request looks like this (warning..its vb)</p>
  
  <pre><code>dim WebHookData as new StringContent("{'strYear'='2018'}",Encoding.UTF8,"application/json")
  
          Dim resp as Task(Of HttpResponseMessage)
          resp = _client.PostAsync(webhook,WebHookData)
          status = resp.Result.Content.ReadAsStringAsync().Result
          if(status.Contains("JobId"))
              status = "Scheduled!"
          End If
  </code></pre>
  
  <p>My Webhook data is being posted to my webhook as this. </p>
  
  <pre><code>{"WebhookName":"myimportjob","RequestBody":"{'strYear'='2018'}","RequestHeader":{"Connection":"Keep-Alive","Expect":"100-continue","Host":"xxx.azure-automation.net","x-ms-request-id":"xxx"}}
  </code></pre>
  
  <p>I am getting this error</p>
  
  <blockquote>
    <p>At line:15 char:42
         + 'The parameter created was ' $webhookBodyObject.strYear
         + ~~~~~~~~~~~~~~~~~~ Unexpected token '$webhookBodyObject' in expression or 
        statement.</p>
  </blockquote>