As the undermentioned demonstrates:
The Start Menu (Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy
) is able to invoke a reboot without updating the OS. However, file:///%SYSTEMROOT%/system32/shutdown.exe
and PowerShell (Core)'s Stop-Computer
commandlet don't appear to provide any option to control whether Windows decides to.
I want this capability because I dual-boot with Linux-based OSes, which necessitates that I adhere to this advice to update Windows:
So the fix where you have Linux/Windows dual boot using standard DOS MBR and GRUB on the Linux partition set active to perform OS selection is to set the Windows partition active before reboot after installing Windows Updates and set it back to Linux afterward.
Because I don't always want to automate that process due to the installed OSes somewhat frequently changing, I reboot into a Fedora 40 SSD via my MB's UEFI GUI, which I invoke programmatically:
#!/usr/bin/env -S pwsh
#Requires -RunAsAdministrator
If ([OperatingSystem]::IsWindows() -Eq $True) {shutdown /r /fw /t 0} # Originated at [this URI](https://superuser.com/revisions/1803550/3#:~:text=shutdown%20/r%20/fw%20(requires%20elevation)%20per%20Microsoft's%20documentation).
However, as aforexplained, this can break when an update is to be applied, due to its inability to specify whethe to apply an update. Consequently, how do I imitate what the Start Menu is doing?