PowerShell 获取最近的Windows更新的检测与安装时间


最近在论坛中看到一个问题,怎样获取Windows 更新最后的检测与安装时间。Get-Hotfix可以显示许多补丁的安装日期,但是不会包含所有的补丁。

注册表保存了最近一次Windwos 更新检测与运行成功的时间:

$props = [ordered]@{ 
LastDetect = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results\Detect' -Name LastSuccessTime | 
select -ExpandProperty LastSuccessTime

LastInstall = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results\Install' -Name LastSuccessTime | 
select -ExpandProperty LastSuccessTime 
}

New-Object -TypeName psobject -Property $props

原文作者:Richard Siddaway

原文链接:When did Windows update last run

 

本文链接: https://www.pstips.net/when-did-windows-update-last-run.html
请尊重原作者和编辑的辛勤劳动,欢迎转载,并注明出处!

关于 Mooser Lee

我是一个Powershell的爱好者,创建了PowerShell中文博客,热衷于Powershell技术的搜集和分享。本站部分内容来源于互联网,不足之处敬请谅解,并欢迎您批评指正。

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注