0

Power shell script return specific exit status, which Control-M is unable to read but exiting with different status. Please let us know how to exit Control-M job with same exit status as returned by power shell script.

Suganya
  • 1
  • 3

2 Answers2

2

Exit <custom error codes> will return custom return codes from the script

runcmd
  • 572
  • 2
  • 7
  • 22
0

In addition to that it is often best to call your Power Shell script via a .bat file. E.g.

  1. Have a Control-M job that is a "command" and has this in the command field -

C:\Program Files\BMC Software\Control-M Agent\Default\Scripts\PS_log_check.bat

  1. The .bat file should then point to your Power Shell script -

powershell -command "& 'C:\Program Files\BMC Software\Control-M Agent\Default\Scripts\PS_log_check.ps1'"

Mark
  • 316
  • 1
  • 5