--- - name: win_file module demo hosts: all tasks: - name: Creating an empty file win_shell: | $value = Test-Path -Path C:\windows\temp if ($value) { New-Item C:\windows\temp\test.txt -ItemType File }