# How do I return data from powershell to ansible playbook

**URL:** <https://forum.ansible.com/t/how-do-i-return-data-from-powershell-to-ansible-playbook/17377>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [January 26, 2015, 9:46pm UTC](https://forum.ansible.com/t/how-do-i-return-data-from-powershell-to-ansible-playbook/17377 "2015-01-26T21:46:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jaime\_Banda](https://avatars.discourse-cdn.com/v4/letter/j/90ced4/32.png) [@Jaime\_Banda](https://forum.ansible.com/u/Jaime_Banda)\
**Post date:** [January 26, 2015, 9:46pm UTC](https://forum.ansible.com/t/how-do-i-return-data-from-powershell-to-ansible-playbook/17377/1 "2015-01-26T21:46:45Z")

</div>

We will use ansible to manage Windows servers, I want to return data from my powershell scripts to the playbook that is executing the script, How can I return data from the PS script? I only know that i need to return a json object.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 27, 2015, 9:06pm UTC](https://forum.ansible.com/t/how-do-i-return-data-from-powershell-to-ansible-playbook/17377/2 "2015-01-27T21:06:05Z")

</div>

that is pretty much it, ansible expects a couple of things in that  
json, like failed: true, in case of error changed: true|false as  
feedback, then the rest can be anything you want, to use this return  
value you just need to register it to a variable.
