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
votes
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"
Set-ExecutionPolicy RemoteSigned
to allow local scripts to run, and only allow remote scripts to run if they are "signed" – Duane Lortiepowershell –ExecutionPolicy Bypass
– Squashman