run a powershell script through scheduler
search cancel

run a powershell script through scheduler

book

Article ID: 245939

calendar_today

Updated On:

Products

CA Workload Automation AE

Issue/Introduction

We are trying to run a powershell through the scheduler but we are running in to issues. I can run through a command prompt just fine but I cant get it to run through a job. is there a certain way I need to set it up?

 

Environment

Release : 12.0

Component : CA Workload Automation AE (AutoSys)

Resolution

Here's example of a job running PowerShell to test network communications. Note the command attribute as you have to call powershell and then pass the appropriate arguments.

Again, this is just an example:

/* ----------------- SAB.POWERSHELL_JOB ----------------- */

insert_job: SAB.POWERSHELL_JOB   job_type: CMD
command: powershell Test-NetConnection -ComputerName lvndev01 -port 7523
machine: W16
owner: Administrator
permission:
date_conditions: 0
alarm_if_fail: 1
alarm_if_terminated: 1