PSWindowsUpdate icon indicating copy to clipboard operation
PSWindowsUpdate copied to clipboard

Get-WURebootStatus - disable yes/no question

Open Orava2 opened this issue 1 year ago • 1 comments

Hello

How can I disable the Y/N question? I don't want to reboot. I just want to get the info ComputerName RebootRequired and RebootScheduled.

PS C:\WINDOWS\system32> Get-WURebootStatus

Reboot is required. Do it now? [Y / N] (default is 'N')
n
ComputerName RebootRequired RebootScheduled
------------ -------------- ---------------
COMP              True

Get-WURebootStatus -Silent does not show the Y/N question but also does not show ComputerName RebootRequired and RebootScheduled.

Orava2 avatar Jan 20 '25 06:01 Orava2

Same issue here. I'm using this project in my automatic Windows Setup Script. The problem, i have, is that it asks this Question even if you're using -IgnoreReboot. The Script starts with -ExecutionPolicy Bypass –NoProfile -NonInteractive, in the script, I've set ConfirmPreference to None with Set-Variable -Name 'ConfirmPreference' -Value 'None' -Scope Global and I'm installing Updates with Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -ForceDownload -ForceInstall -IgnoreReboot -Confirm:$false -ErrorAction SilentlyContinue -WarningAction SilentlyContinue but it still requires user-input. What's funny is that it tells me first Reboot is required but do it manually and then like 5 seconds later it asks for user-input. Yes, I'm aware of the -Silent Parameter but then i encountered on another Bug which simply ignores about the additional updates and that's why i can't use -Silent.

craeckor avatar Mar 11 '25 14:03 craeckor