Skip to content

$cs.Job_RebootWS

Marks that this PowerPack requires the workstation to reboot afterwards. This does not reboot the machine immediately — when the script later calls Exit-PSScript with 0 (or 3326), CapaInstaller uses this flag to trigger the actual reboot for the deployment as a whole. Calling it again after a reboot has already been requested is safe; it simply logs that a reboot was already requested.

$cs.Job_RebootWS(string text)

Message written to the log explaining why the reboot is required.

None

Signal a reboot after a driver installation completes:

Terminal window
$cs.Job_WriteLog("Driver installation requires a reboot to complete")
$cs.Job_RebootWS("Reboot required after driver installation")
Exit-PSScript 0

Signal a reboot after enabling a Windows optional feature, which typically requires one to take effect:

Terminal window
Enable-WindowsOptionalFeature -Online -FeatureName "TelnetClient" -All -NoRestart
$cs.Job_WriteLog("TelnetClient feature enabled, reboot needed before it is usable")
$cs.Job_RebootWS("Reboot required after enabling TelnetClient Windows feature")
Exit-PSScript 0

Exit-PSScript