Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<?xml version="1.0" encoding="ISO-8859-1"?>

<job  process_class="/tests/Agent" stop_on_error="no">
    <script  language="powershell">
        <![CDATA[
function spooler_process(){
		
	# set variables to store the information about job and task 	
	$jobName = $spooler_job.name()
	$jobTitle = $spooler_job.title()
	$taskID = $spooler_task.id()
	
	# show the information about job and task
	echo "job $jobName with title $jobTitle is starting"
	echo "task ID is $taskID"
		
	echo "job is finishing"
		
	# for standalone jobs set to false / for order jobs set to true
	return $false
}
        ]]>
    </script>
    <run_time />
</job>
Info

For further information about how to write API Jobs in PowerShell, have a look at http://www.sos-berlin.com/doc/en/scheduler.doc/api/api-powershell.xml. You will find the available methods as well as some useful examples for your API jobs.

 

Example: Combination of both (PowerShell Job with Monitor as a Pre-Processing job)

...

Code Block
# Example Shell: 
echo name1 = value2 >> %SCHEDULER_RETURN_VALUES%

# Example PowerShell: 
$spooler_task.order().params().set_value("name1","value2")

  

References

Reference Documentation

Change Management References

Jira
serverSOS JIRA
columnstype,key,issuelinks,fixversions,status,priority,summary,updated
maximumIssues20
jqlQuerylabels in (scripting-powershell)
serverId6dc67751-9d67-34cd-985b-194a8cdc9602