Here is the powershell command on my playbook:
- name: "Execute Powershell from Ansible"
ignore_errors: yes
ansible.windows.win_shell: (Get-Acl -Path "C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Binn") | Format-list
Here is error from ansible:
{
"ansible_loop_var": "item",
"_ansible_no_log": false,
"item": "(Get-Acl -Path \"C:\\Program Files\\Microsoft SQL Server\\MSSQL13.MSSQLSERVER\\MSSQL\\Binn\") | Format-list",
"changed": false,
"msg": "Get-AnsibleParam: Missing required argument: _raw_params",
"_ansible_item_label": "(Get-Acl -Path \"C:\\Program Files\\Microsoft SQL Server\\MSSQL13.MSSQLSERVER\\MSSQL\\Binn\") | Format-list"
}