How to smart home a step by step guide to your personal internet of things 3rd edition (2015)

Page 269

PowerShell editor, paste in the command (along with the complete path to our mailsend directory) and store it under something like ormail.ps1 (Figure 14.2). Again we test our work by executing the script from within the PowerShell editor. As the last step we now need to configure Task Scheduler to run ormail.ps1 at startup. We select Start — Control Panel — System and Security — Administrative Tools — Task Scheduler. Then we click on the Action menu and select Create Basic Task. We give the task a name like OR Reboot Notification, select Next, and then When the computer starts. Now we select Start a program and enter powershell.exe in the program/script field and C:\Users\smarthome\mailsend\ormail.ps1 in the Add arguments field (Figure 14.3). Of course we can now also add the openremote.bat run command to our Powershellscript ormail.ps1 and only schedule a single task for startup. Finally, with a few reboots of our system we validate the functionality of our auto reboot and notification email capabilities.

Figure 14.2 PowerShell script for sending the reboot notification email


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.