Boxstarter execution environment and privileges
developBoxstarter manages the execution environment to ensure scripts run with the necessary permissions and minimal interruption:
- Administrator Elevation: Boxstarter ensures scripts run as Administrator. If
Invoke-Boxstarteris called from a non-elevated shell, it will launch an elevated shell for the remainder of the session. - UAC Management: If reboots are enabled and UAC is active, Boxstarter will temporarily disable UAC to allow for an unattended execution experience and re-enable it after the machine reboots and the script restarts.
- Service Management: To minimize interruptions, Boxstarter stops the Windows Update Service and the System Configuration Client (if installed) during execution. These services are automatically restarted when the script completes.
- Logging: Boxstarter provides functions to log to the screen, the Boxstarter Log, or both simultaneously. It also captures standard output and error streams from command-line executables.