Skip to content

Instantly share code, notes, and snippets.

@trondhindenes
Created September 12, 2014 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trondhindenes/ea42b3cb517fec95bf8b to your computer and use it in GitHub Desktop.
Save trondhindenes/ea42b3cb517fec95bf8b to your computer and use it in GitHub Desktop.
Check for pending reboot using the servermanager namespace
# Check if reboot is required. The MSFT_ServerManagerTasks provider is missing on client SKUs
$featureData = invoke-wmimethod -EA Ignore -Name GetServerFeature -namespace root\microsoft\windows\servermanager -Class MSFT_ServerManagerTasks
if($featureData -and $featureData.RequiresReboot)
{
Write-Verbose "Computer needs a reboot"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment