Skip to content

Commit

Permalink
Fix reboot check
Browse files Browse the repository at this point in the history
  • Loading branch information
AgenttiX committed Nov 3, 2023
1 parent 2370225 commit 0c83f69
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Install-Software.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ if ($OtherSelected.Count) {
Show-Output "No other operations were selected."
}

if ((Test-CommandExists "Test-PendingReboot") -and (Test-PendingReboot -SkipConfigurationManagerClientCheck).IsRebootPending) {
if ((Test-CommandExists "Test-PendingReboot") -and (Test-PendingReboot -SkipConfigurationManagerClientCheck -SkipPendingFileRenameOperationsCheck).IsRebootPending) {
Show-Output -ForegroundColor Cyan "The computer is pending a reboot. Please reboot the computer."
}
Show-Output -ForegroundColor Green "The installation script is ready. You can now close this window."
Expand Down
4 changes: 2 additions & 2 deletions Maintenance.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ if (Test-CommandExists "docker") {
# This should be the last step in the script so that its updates are not installed during other updates.
if ($Reboot -or $Shutdown) {
Show-Output -ForegroundColor Cyan "Driver updates will not be started, as automatic reboot or shutdown is enabled."
} elseif ((Test-CommandExists "Test-PendingReboot") -and (Test-PendingReboot -SkipConfigurationManagerClientCheck).IsRebootPending) {
} elseif ((Test-CommandExists "Test-PendingReboot") -and (Test-PendingReboot -SkipConfigurationManagerClientCheck -SkipPendingFileRenameOperationsCheck).IsRebootPending) {
Show-Output -ForegroundColor Cyan "Driver updates will not be started, as the computer is pending a reboot."
} else {
# Lenovo Vantage (non-blocking)
Expand Down Expand Up @@ -614,7 +614,7 @@ if ($Reboot) {
Show-Output -ForegroundColor Cyan "The computer will be shut down in 10 seconds."
shutdown /s /t 10 /c "Mika's maintenance script is ready. Shutting down."
} else {
if ((Test-CommandExists "Test-PendingReboot") -and (Test-PendingReboot -SkipConfigurationManagerClientCheck).IsRebootPending) {
if ((Test-CommandExists "Test-PendingReboot") -and (Test-PendingReboot -SkipConfigurationManagerClientCheck -SkipPendingFileRenameOperationsCheck).IsRebootPending) {
Show-Output -ForegroundColor Cyan "The computer is pending a reboot. Please reboot the computer, once all the updater windows that are open say that they are ready."
}
Show-Output -ForegroundColor Green "You can now close this window."
Expand Down
2 changes: 1 addition & 1 deletion Utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ function Test-PendingRebootAndExit {
Show-Output -ForegroundColor Cyan "Ensuring that the PowerShell reboot checker module is installed. You may now be asked whether to install the NuGet package provider. Please select yes."
Install-Module -Name PendingReboot -Force
}
if ((Test-CommandExists "Test-PendingReboot") -and (Test-PendingReboot -SkipConfigurationManagerClientCheck).IsRebootPending) {
if ((Test-CommandExists "Test-PendingReboot") -and (Test-PendingReboot -SkipConfigurationManagerClientCheck -SkipPendingFileRenameOperationsCheck).IsRebootPending) {
Show-Output -ForegroundColor Cyan "A reboot is already pending. Please close this window, reboot the computer and then run this script again."
if (! (Get-YesNo "If you are sure you want to continue regardless, please write `"y`" and press enter.")) {
Exit 0
Expand Down

0 comments on commit 0c83f69

Please sign in to comment.