使用 Ansible 运行 PowerShell 命令
您可以使用 Ansible 的 'win_shell' 模块来运行 PowerShell 命令。以下是示例:
- name: Run PowerShell command
win_shell: '{{ command }}'
vars:
command: Get-Process
在这个例子中,'win_shell' 模块将运行 'Get-Process' 命令。您可以将命令替换为您想要运行的任何其他 PowerShell 命令。
原文地址: https://www.cveoy.top/t/topic/nniu 著作权归作者所有。请勿转载和采集!