1
votes

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.

1
make sure you have ran a powershell as admin and do Set-ExecutionPolicy RemoteSigned to allow local scripts to run, and only allow remote scripts to run if they are "signed"Duane Lortie
Did you try powershell –ExecutionPolicy BypassSquashman
2017-01-30 11:51:48.94 ea4: Task "test": Script Command Line App returned error 1: WARNING - 'c:\temp\batch.bat ' returned failure code #1 2017-01-30 11:51:48.94 ea4: Failed to perform all process(es) against All files 2017-01-30 11:51:48.94 ea4: One or more one-time scripts failed, so I'm suppressing file processing. 2017-01-30 11:51:48.96 ea4: Task "test": Encountered 1 errornicole
change the command to C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.EXE -NoLogo -NoProfile –ExecutionPolicy Bypass -Command c:\temp\GL_Format_Update.ps1nicole
sorry, keep hiting return. MoveIT service is running under local admin account so assum the script is also running under local admin accountnicole

1 Answers

0
votes

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"