Microsoft WinRM 操作符

使用 WinRMOperator 在给定远程主机上使用 winrm_hook 执行命令

创建一个 hook

tests/system/microsoft/winrm/example_winrm.py[源代码]

winRMHook = WinRMHook(ssh_conn_id="ssh_POC1")

运行操作符,传递 hook,并传递一个命令来执行某些操作

tests/system/microsoft/winrm/example_winrm.py[源代码]

t1 = WinRMOperator(task_id="wintask1", command="ls -altr", winrm_hook=winRMHook)

t2 = WinRMOperator(task_id="wintask2", command="sleep 60", winrm_hook=winRMHook)

t3 = WinRMOperator(task_id="wintask3", command="echo 'luke test' ", winrm_hook=winRMHook)

此条目是否有帮助?