Michael,
Have you set up a windows agent to act as a powershell interpreter? The ini file for a WINDOWS agent needs to be configured to act as a powershell interpreter. it will require a windows agent license,
SEE EXAMPLE ini file below
start the agent and create a windows job, clicking on interpreter in the WINDOWS tab.
use your powershell scripts (point to them in the process tab, or write the powershell code in the process tab)
here is an example..
[GLOBAL]
name=POWERSHELL
system=UC4
logon=1
language=(E,D)
logging=..\TEMP\powershell_LOG_##.TXT
logcount=10
helplib=UC.MSL
helpcache=ALL
licence_class=9
; userid_type=INCL
; use Windows Job Objects 0=no/1=yes
useJobObject=0
ECPEXE=C:\windows\system32\windowspowershell\v1.0\powershell.exe
ECPEXT=PS1
ft_temp_file=yes
HomeDirCache=10
; FileProcessingMaxDepth = 0
; FileProcessingTimeout = 0
[USERID]
; user/domain=START
[STATUS_CHECK]
time=1
[VARIABLES]
UC_HOST_CODE=UC_CODE
UC_HOST_JCL_VAR=WINDOWS
UC_EX_PATH_BIN=.
UC_EX_PATH_TEMP=..\TEMP\
UC_EX_PATH_JOBREPORT=..\TEMP\
UC_EX_JOB_MD=.\UCXJWX6M.EXE
UC_EX_PATH_BACKUP=..\BACKUP
[TRACE]
file=..\TEMP\POWERSHELL_TRACE_##.TXT
trccount=2
tcp/ip=0
mail=0
filetransfer=0
event=0
compress=0
memory=0
[TCP/IP]
port=2321
bindaddr=
bindlocal=0
; try all n seconds to connect to server
connect=60
report=60
SendBufferSize=1048576
RecvBufferSize=1048576
cp=YOURUC4SERVER:2217
TcpKeepAliveTime=yes
tcp_nodelay=yes
[HOSTS]
; Overwrite IP destination in case of IP NATing problems
; (e.g. firewalls)
; <UC4-name>=<dns-name> or
; <UC4-name>=<ip-addr>
[CP_LIST]
2218=192.168.0.20
[AUTHORIZATION]
KeyStore=
InitialPackage=
here is a simple get-executionpolicy script that writes the output to a file ( this uses both uc4 variables and powershell variables) this is placed in the process tab of your new job
$date = (get-date).dayofyear
get-executionpolicy | out-file "c:\temp\&$AGENT#\$date.log"
write-host "* * * * * * * * * *"
write-host (" Return Code: $? " -f $LastExitCode)
write-host "* * * * * * * * * *"
exit $LastExitCode
it writes the return code to the job's report and the output to a file in c:\Temp\PowerShell\40.log
you can use output filters to check for errors..