Created
September 12, 2014 09:16
-
-
Save trondhindenes/ea42b3cb517fec95bf8b to your computer and use it in GitHub Desktop.
Check for pending reboot using the servermanager namespace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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