如何在MoveIT Central中执行PowerShell脚本? [英] How to execute PowerShell script in MoveIT central?

查看:61
本文介绍了如何在MoveIT Central中执行PowerShell脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个bat文件包含命令em32\WindowsPowerShell\v1.0\powershell.EXE -NoLogo -NoProfile -Command c:\temp\GL_Format_Update.ps1.然后使用MoveIT Central中的命令行App执行bat文件.该脚本无法产生预期的输出文件.命令可以在CMD窗口中成功运行.看来MoveIT服务所有者无法执行PowerShell脚本.

I have a bat file include command em32\WindowsPowerShell\v1.0\powershell.EXE -NoLogo -NoProfile -Command c:\temp\GL_Format_Update.ps1. Then used command line App in MoveIT central to execute bat file. The script can't produce the output file as expected. Command can be run in CMD window successfully. It seems like MoveIT service owner can't execute PowerShell script.

推荐答案

我遇到了类似的问题,发现仅将整个命令放入CommandLineApp_AppPath就会引发错误.通过将其分解为通往Powershell的路径和通往Powershell的参数,我能够成功调用并执行我的脚本.我的脚本还使用了3个参数.

I had a similar issue and found that simply putting the entire command into the CommandLineApp_AppPath was throwing an error. By breaking it up into the path to powershell and the arguments to powershell, I was able to successfully call and execute my script. My script also took 3 parameters.

使用流程创建任务.选择内置脚本命令行应用程序".设置参数如下:

Create a task with a process. Select the built-in script "Command Line App". Set the parameters as follows:

CommandLineApp_AppPath = C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.EXE
CommandLineApp_AppParms = -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "E:\PowerShell\CreateManifest.ps1 -Folder \\mdcvmsfms11u\DataTransfer\BFClientGateway\Test\Download\2129\PPfAandDP -ManifestName MS_CONTROL_ -OutputType FULL"

这篇关于如何在MoveIT Central中执行PowerShell脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆