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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| cmd | string | Command line to execute; accepts free-form syntax | ||
| chdir | string | Working directory for the command | ||
| creates | string | Skip when this path or wildcard pattern exists | ||
| removes | string | Skip when this path or wildcard pattern does not exist | ||
| stdin | string | Text to write to the command standard input | ||
| output_encoding_override | string | Override the UTF-8 output encoding with a named character encoding | ||
| argv | []string | Executable and arguments using Win32 C argument quoting |
Example
yaml
- name: Inspect the current user
ansible.windows.win_command:
argv: [whoami.exe, /all]