When using stop-computer or restart-computer, one should be able to log a reason code and custom message similar to the way that shutdown.exe with /d P:0:1 and /c "Custom Message". This would allow you to stay in powershell without needing to call out to win32 executable. See similar concern:
https://stackoverflow.com/questions/15656106/restarting-pcs-and-writing-to-the-event-log-with-a-custom-message
When using stop-computer or restart-computer, one should be able to log a reason code and custom message similar to the way that shutdown.exe with /d P:0:1 and /c "Custom Message". This would allow you to stay in powershell without needing to call out to win32 executable. See similar concern:
https://stackoverflow.com/questions/15656106/restarting-pcs-and-writing-to-the-event-log-with-a-custom-message