boxstarter icon indicating copy to clipboard operation
boxstarter copied to clipboard

Install-windowsupdate error when restarting

Open mwrock opened this issue 10 years ago • 4 comments

migrated from https://boxstarter.codeplex.com/workitem/57

When using the command Install-windowsupdate from BoxstarterShell everything works until the first restart. Errormessage as follows:

+ Boxstarter starting Downloading 1 updates
+ Boxstarter finished Downloading 1 updates 00:00:03.6635341
+ Boxstarter starting Installing Updates
This may take several minutes...
Boxstarter: Restart Required. Restarting now...
+ Boxstarter finished Installing Updates 00:41:21.6046543
Boxstarter: writing restart file
You cannot call a method on a null-valued expression.
At C:\Users\MyUser\AppData\Roaming\Boxstarter\Boxstarter.Bootstrapper\Invoke-Reboot.ps1:38 char:32
+ $Boxstarter.NoPassword.ToString <<<< ()
    + CategoryInfo          : InvalidOperation: (ToString:String) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

PS C:\>  

mwrock avatar Sep 16 '14 05:09 mwrock

Need to support Install-Windows Update outside of a boxstarter run

mwrock avatar Sep 16 '14 05:09 mwrock

@pauby - imo there are two possible ways to resolve this..

*1: change the reboot-wrapper for the sched.tasks so it always loads the full boxstarter context before executing anything *2: modify Install-WindowsUpdate so it doesn't rely on any boxstarter functionality.

what'd you suggest we should go for?

mwallner avatar Mar 18 '19 13:03 mwallner

I'm inclined to go with 1 primarily because it seems like something you'd want after a reboot anyway?

pauby avatar Mar 18 '19 14:03 pauby

this might be fixed with Boxstarter v3, I'm moving it to take a look at again in milestone 3.0.1 anyway.

mwallner avatar Feb 16 '22 20:02 mwallner