简体   繁体   English

如何使用Rundeck运行位于远程服务器中的Powershell文件

[英]How to run the Powershell File which Located in remoted Server using rundeck

I Need to Execute the Power shell file which located in the remote Machine using rundeck. 我需要使用rundeck执行位于远程计算机中的Power shell文件。

So far I have done this: 到目前为止,我已经做到了:

  1. Create a Node with the server AS123 使用服务器AS123创建节点
  2. Created a New Job Under the Projects. 在项目下创建了新工作。
  3. In the Job Workflow I have chosen Add a Step -> Script file or URL and did the below Setup. 在工作流程中,我选择了添加步骤-> 脚本文件或URL ,并进行了以下设置。

在此处输入图片说明

This setup is searching for the Powershell file path in the rundeck server rather than the remote host server AS123 . 此设置在rundeck服务器而不是远程主机服务器AS123中搜索Powershell文件路径。

Can anyone share the steps How to call the powershell which is hosted in remote Server and Execute the same on the remote host. 任何人都可以共享步骤如何调用远程服务器中托管的Powershell并在远程主机上执行相同的步骤。

use one of the following instead. 请使用以下之一。 Personally I prefer using the inline script cause it more flexible. 就我个人而言,我更喜欢使用内联脚本以使其更加灵活。

在此处输入图片说明

use the exact command line you use when running the script locally on your server via cygwin (I presume). 使用通过cygwin在服务器上本地运行脚本时使用的确切命令行(我猜想)。 ie

powershell.exe 'd:\scripts\test\fun-test.ps1' -path Testing

Make sure to select dispatch to nodes and filter your relevant server. 确保选择调度到节点并过滤您的相关服务器。

在此处输入图片说明

When using 'script file or URL' it should be a path rundeck can access cause it runs locally on the rundeck server. 使用“脚本文件或URL”时,它应该是rundeck可以访问的路径,因为它在rundeck服务器上本地运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用管道在 Rundeck 中运行 Powershell 命令 - How to run a Powershell command in Rundeck with pipes PowerShell-将文件重命名为文件所在的文件夹的名称 - PowerShell - Rename file to the name of the folder in which it is located 无法运行位于远程 Azure VM D 中的远程 powershell 脚本:使用 Invoke-Command 的驱动器 - Unable to run remote powershell script which is located in remote Azure VM D: drive using Invoke-Command Powershell - 如何运行位于另一台计算机上的脚本? - Powershell - how to run a script located on another computer? TeamCity Kotlin DSL:如何从位于 DSL 文件夹中的文件运行 PowerShell 脚本 - TeamCity Kotlin DSL: how to run a PowerShell script from file located in the DSL folder 从 PowerShell 运行位于 Program Files (x86) 中的文件 - Run a File, located in Program Files (x86) from PowerShell 使用php运行包含powershell脚本的bat文件? - Run bat file which contains powershell script using php? 无法通过powershell执行位于不同服务器的exe文件 - Not able to execute exe file located at different server through powershell 如何使用 PowerShell 运行 .reg 文件? - How to run the .reg file using PowerShell? 如何使用powershell运行.exe文件? - how to run .exe file using powershell?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM