-
Notifications
You must be signed in to change notification settings - Fork 13
Test‑PendingRestart
Tests if the computer is pending a restart.
Test-PendingRestart [[-Check] <PendingRestartCheck>] [<CommonParameters>]
This function checks various registry locations, the Component-Based Servicing, Windows Update, Pending File Rename Operations, Pending Computer Rename, Pending Domain Join, and SCCM Client to determine if the computer is pending a restart.
Test-PendingRestart
Returns $true if the computer is pending a restart, otherwise returns $false.
Test-PendingRestart -Check WindowsUpdate, ComponentBasedServicing
Checks only Windows Update and Component-Based Servicing for pending restarts. Returns $true if either condition requires a restart, otherwise returns $false.
Specifies which pending restart checks to perform. Multiple values can be specified by using the bitwise OR operator. By default, all checks are performed.
Available options are:
- ComponentBasedServicing: Checks Component-Based Servicing registry key
- WindowsUpdate: Checks Windows Update Auto Update registry key
- PendingFileRename: Checks PendingFileRenameOperations registry key
- PendingComputerRename: Checks for pending computer rename
- PendingDomainJoin: Checks for pending domain join
- ConfigurationManagerClient: Checks Configuration Manager client for pending reboots
- All: Performs all checks (default)
Type: PendingRestartCheck
Parameter Sets: (All)
Aliases:
Accepted values: ComponentBasedServicing, WindowsUpdate, PendingFileRename, PendingComputerRename, PendingDomainJoin, ConfigurationManagerClient, All
Required: False
Position: 1
Default value: All
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
This command checks for the following conditions:
- Windows Update Auto Update (RebootRequired)
- Component-Based Servicing (RebootPending)
- Pending File Rename Operations
- Pending Computer Rename
- Pending Domain Join
- Pending SCCM Client Reboot
- Assert-BoundParameter
- Assert-ElevatedUser
- Assert-IPAddress
- Assert-Module
- Compare-DscParameterState
- Compare-ResourcePropertyState
- ConvertFrom-DscResourceInstance
- ConvertTo-CimInstance
- ConvertTo-HashTable
- Find-Certificate
- Format-Path
- Get-ComputerName
- Get-DscProperty
- Get-EnvironmentVariable
- Get-FileProductVersion
- Get-LocalizedData
- Get-LocalizedDataForInvariantCulture
- Get-PSModulePath
- Get-RegistryPropertyValue
- Get-TemporaryFolder
- Get-UserName
- New-ArgumentException
- New-ErrorRecord
- New-Exception
- New-InvalidDataException
- New-InvalidOperationException
- New-InvalidResultException
- New-NotImplementedException
- New-ObjectNotFoundException
- Remove-CommonParameter
- Set-DscMachineRebootRequired
- Set-PSModulePath
- Test-AccountRequirePassword
- Test-DscParameterState
- Test-DscProperty
- Test-IsNanoServer
- Test-IsNumericType
- Test-ModuleExist
- Test-PendingRestart