title: How to read the value returned by a powershell script with ansible
body: <p>I am trying the following Powershell script:</p>
  <pre class="lang-bsh prettyprint-override"><code>Function jello-code {
      return &quot;jello&quot;
  }
  
  jello-code
  </code></pre>
  <p>In Ansible playbook I have a task defined as</p>
  <pre class="lang-yaml prettyprint-override"><code>- name : run jello script.
    win_shell: C:Projects\scripts\jello.ps1
    args:
      chdir:  C:Projects\scripts
    register : script_return
  - debug : msg = {{script_return.stdout}}
  </code></pre>
  <p>Currently the value shown by debug task is</p>
  <pre><code>ok: [clientmachine.com] =&gt; {
      &quot;msg&quot;: &quot;Hello world!&quot;
  }
  </code></pre>
  <p>I always get the same <em>&quot;Hello world!&quot;</em> message.</p>
  <p>My goal is to do other tasks based on the value returned by the Powershell script.</p>