Skip to content

Instantly share code, notes, and snippets.

@trondhindenes
Created October 13, 2014 09:38
Show Gist options
  • Save trondhindenes/9ec8f71bfc69d81c25c5 to your computer and use it in GitHub Desktop.
Save trondhindenes/9ec8f71bfc69d81c25c5 to your computer and use it in GitHub Desktop.
# Check if reboot is required, if so notify CA. The MSFT_ServerManagerTasks provider is missing on client SKUs
$featureData = invoke-wmimethod -EA Ignore -Name GetServerFeature -namespace root\microsoft\windows\servermanager -Class MSFT_ServerManagerTasks
$regData = Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" "PendingFileRenameOperations" -EA Ignore
if(($featureData -and $featureData.RequiresReboot) -or $regData)
{
Write-Verbose $LocalizedData.MachineRequiresReboot
$global:DSCMachineStatus = 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment