0

Following two points are completed from my end

  1. I have two different phantom js scripts on my local machine which will capture the screenshots and save it my local.

  2. I have one powershell script to send the captured images through mail.

My requirement is as below

Need one consolidated script where i can configure the above two in one script and then i will update my task scheduler to run the consolidated script to send the mail daily at 6PM.

I am looking for powershell as my final consolidated script which will run the phantom js first and run the send_mail.ps1 .

I have used following commands to run

 C:\phantomjs-2.1.1-windows\phantomjs-2.1.1-windows\bin> .\phantomjs.exe I:\my_code\capture_screenshot1.js  --> (Capture screenshot and put under C:\Images)
 C:\phantomjs-2.1.1-windows\phantomjs-2.1.1-windows\bin> .\phantomjs.exe I:\my_code\capture_screenshot2.js  --> (Capture screenshot and put under C:\Images)
 C:\phantomjs-2.1.1-windows\phantomjs-2.1.1-windows\bin> cd I:\my_code\
 I:\my_code> .\send_mail.ps1  --> (Send Mail from taking the images from C:\Images)

I just need single consolidated script to run the above 3 commands.

Harish P C
  • 107
  • 1
  • 15

1 Answers1

0

You should be able to start the phantomjs exe from powershell.

It would be something like

CD c:\path\to\phantomjs
.\phantomjs.exe I:\my_code\capture_screenshot1.js
.\phantomjs.exe I:\my_code\capture_screenshot2.js
**contents of sendmail.ps1**
Ryan McVicar
  • 103
  • 7