This is a module to create, update, and remove files and folders on remote Windows hosts. This sample playbook shows how to manage a file and folder on a Windows system:
- name: add a new file
win_file:
path: C:scriptsPSscript2.ps1
state: touch
- name: remove a folder
win_file:
path: C:scriptsTestScripts
state: absent
This module does not change file permissions. To do this, you need to use the win_share module.