[英]Run multiple javascripts with powershell
我完成以下兩點
我在本地計算機上有兩個不同的phantom js腳本,它們將捕獲屏幕截圖並將其保存在本地。
我有一個powershell腳本通過郵件發送捕獲的圖像。
我的要求如下
需要一個整合腳本,在這里我可以在一個腳本中配置以上兩個腳本,然后我將更新任務計划程序以運行整合腳本以每天下午6點發送郵件。
我正在尋找Powershell作為我的最終合並腳本,該腳本將首先運行幻影js並運行send_mail.ps1。
我已經使用以下命令運行
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)
我只需要一個合並腳本即可運行上述3個命令。
您應該能夠從Powershell啟動phantomjs exe。
就像
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**
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.