Connected to power check

is there a built-in feature to check whether the computer is connected to power and if not, it will pop up a warning to connect to power before psappdeploytoolkit runs? thanks

You can use Test-Battery to check whether they are on AC power or not and based on that you can display a popup. You can either build your own popup through WindowsForms or use built in Show-* functions depending on what kind of popup do you need.