$cs.Job_RebootWS
Description
Section titled “Description”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.
Syntax
Section titled “Syntax”$cs.Job_RebootWS(string text)
Parameters
Section titled “Parameters”text (String)
Section titled “text (String)”Message written to the log explaining why the reboot is required.
Return value
Section titled “Return value”None
Example
Section titled “Example”Signal a reboot after a driver installation completes:
$cs.Job_WriteLog("Driver installation requires a reboot to complete")$cs.Job_RebootWS("Reboot required after driver installation")Exit-PSScript 0Signal a reboot after enabling a Windows optional feature, which typically requires one to take effect:
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