PARALLAX

win_command

Execute a Windows process without a shell

Collection: ansible.windows

Full Name: parallax.windows.win_command

Aliases: ansible.windows.win_command, win_command

Synopsis

Execute a Windows process without a shell

Parameters

NameTypeRequiredDefaultDescription
cmdstringCommand line to execute; accepts free-form syntax
chdirstringWorking directory for the command
createsstringSkip when this path or wildcard pattern exists
removesstringSkip when this path or wildcard pattern does not exist
stdinstringText to write to the command standard input
output_encoding_overridestringOverride the UTF-8 output encoding with a named character encoding
argv[]stringExecutable and arguments using Win32 C argument quoting

Example

yaml
- name: Inspect the current user
  ansible.windows.win_command:
    argv: [whoami.exe, /all]
Search
    ↑ ↓ move↵ openesc close