# Custom facts Windows

**URL:** <https://forum.ansible.com/t/custom-facts-windows/25768>\
**Category:** Ansible Developer\
**Tags:** windows\
**Created:** [October 18, 2017, 9:11am UTC](https://forum.ansible.com/t/custom-facts-windows/25768 "2017-10-18T09:11:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![belajzus](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@belajzus](https://forum.ansible.com/u/belajzus)\
**Post date:** [October 18, 2017, 9:11am UTC](https://forum.ansible.com/t/custom-facts-windows/25768/1 "2017-10-18T09:11:52Z")

</div>

Hi,

is it possible to use custom facts on Windows machines, which is the location for storing fact scripts…

Thank you

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [October 18, 2017, 9:13pm UTC](https://forum.ansible.com/t/custom-facts-windows/25768/2 "2017-10-18T21:13:48Z")

</div>

According to the setup module [http://docs.ansible.com/ansible/latest/setup\_module.html](http://docs.ansible.com/ansible/latest/setup_module.html), you can specify a path to a folder where it will execute custom scripts.

`

- setup:  
fact\_path: C:\temp  
`

With the example above, it will gather the normal facts but will also run each “.ps1” script in C:\temp and add them to the facts. The scripts must output a JSON string which Ansible then adds to the facts returned, this can be done like so

`  
$facts = @{}  
$facts.ansible\_custom\_fact = “custom fact”

Write-Output (ConvertTo-Json -InputObject $facts -Compress)  
`
