Using Powershell with Action Script

Im trying to create a task where a powershell script is embedded with an action script. Purpose of the powershell script is to obtain data and write it a file named “results.txt”. What I want the action script to do is:

  1. check if “results.txt” exists and if it does then to delete it
  2. run the powershell script

anyone has a template or action script code that they can share to assist with this request.

Thank you!

Something like this …

if {exists file "path\results.txt"}
delete "path\results.txt"
delete __createfile
createfile until EENNDD

insert your powershell here

EENNDD
copy __createfile path\something.ps1
wait powershell.exe path\something.ps1 -optional arguements
endif