mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
moved pending reboot to powershell.ps1
This commit is contained in:
parent
e36b4014f5
commit
ad4eb751a5
1 changed files with 17 additions and 0 deletions
|
@ -225,3 +225,20 @@ Function Get-FileChecksum($path)
|
||||||
}
|
}
|
||||||
return $hash
|
return $hash
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Function Get-PendingRebootStatus
|
||||||
|
{
|
||||||
|
# Check if reboot is required, if so notify CA. The MSFT_ServerManagerTasks provider is missing on client SKUs
|
||||||
|
#Function returns true if computer has a pending reboot
|
||||||
|
$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)
|
||||||
|
{
|
||||||
|
return $True
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return $False
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue