AM Asset Job could be of type :
Command : DOS/Windows command (.bat, .cmd)
Script : DMS script
But how to execute a .ps1 script (powershell) ?
Release : All
Component : Client Automation
1- Create a new AM Asset Job and select "External Utility" as Job Type :
2- Click NEXT and give a name. Click NEXT
3- Enter following values :
Executable: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exeWorking dir: C:\Windows\TEMP
Parameters: -ExecutionPolicy ByPass -File C:\Windows\TEMP\test.ps1
Create text file: C:\Windows\TEMP\test.ps1
Example :
[string]$LogFile = "C:\Windows\temp\file.log"
Add-Content -Path $Logfile -Value "Hello World."
5- Click NEXT. Click on Set Scheduling button and select tab "Miscellaneous'.
Check the box "This job is allowed to run unattended"