[玩转系统] PSWindowsUpdate - 管理 Windows 更新
作者:精品下载站 日期:2024-12-14 17:27:37 浏览:16 分类:玩电脑
PSWindowsUpdate - 管理 Windows 更新
`PSWindowsUpdate
` 模块是一个 PowerShell 模块,提供用于管理 Windows 更新的 cmdlet。它在 Windows 中默认不可用,但可以从 PowerShell Gallery 免费获取。
PSWindowsUpdates 模块可用于执行以下操作:
- 检查可用的更新
- 安装 Windows 更新
- 删除 Windows 更新
- 隐藏更新
- 查看更新历史
- 列出可用更新
在本文中,我们将讨论如何使用 PSWindowsUpdate 模块来管理 Windows 更新。
如何在 Windows 中安装 PSWindowsUpdate 模块
要在 Windows 中安装 PSWindowsUpdate
模块,请在 PowerShell 中运行以下命令。
Install-Module PSWindowsUpdate
在上面的 PowerShell 脚本中,Install-Module
命令安装 PSWindowsUpdate
模块。
下面给出了安装 PSWindowsUpdate
模块的上述 PowerShell 脚本的输出。
安装模块后,您可以使用以下命令获取有关 PSWindowsUpdate 的信息。
Get-Commmand -module PSWindowsUpdate
此 PowerShell 命令返回 PSWindowsUpdate 模块中可用的 cmdlet 列表。
上述命令的输出显示所有 cmdlet 的列表。
让我们了解一下模块命令的简要说明。
- Clear-WUJob:从任务计划程序中清除 Windows 更新作业。
- 下载 WindowsUpdate: 下载可用的 Windows 更新。
- Get-WUInstall:获取有关待安装的 Windows 更新的信息。
- Get-WUList: 显示可用 Windows 更新的列表。
- 隐藏 WindowsUpdate:隐藏特定的 Windows 更新。
- 安装WindowsUpdate:安装挂起的Windows更新。
- Show-WindowsUpdate:显示隐藏的 Windows 更新。
- 取消隐藏-WindowsUpdate:取消隐藏以前隐藏的 Windows 更新。
- Uninstall-WindowsUpdate:卸载特定的 Windows 更新。
- Add-WUServiceManager: 注册 Windows Update 服务管理器。
- Enable-WURemoting:为远程 PSWindowsUpdate 使用启用 Windows Defender 防火墙规则。
- Get-WindowsUpdate:获取可用 Windows 更新的列表并管理其安装。
- Get-WUApiVersion:检索 Windows 更新代理版本。
- Get-WUHistory:显示已安装更新的历史记录。
- Get-WUInstallerStatus:检查 Windows Installer 服务状态。
- Get-WUJob:检查任务计划程序中的 Windows 更新作业任务。
- Get-WULastResults:获取上次搜索和安装结果。
- Get-WUOfflineMSU:检索脱机MSU文件信息。
- Get-WURebootStatus:检查更新是否需要重新启动系统。
- Get-WUServiceManager:列出可用的更新源。
- Get-WUSettings:检索 Windows 更新客户端设置。
- Invoke-WUJob:远程执行PSWindowsUpdate任务。
- 删除-WindowsUpdate:删除特定的 Windows 更新。
- Remove-WUServiceManager:禁用 Windows 更新服务管理器。
- Reset-WUComponents:将 Windows Update 代理重置为其默认状态。
- Set-PSWUSettings: 将 PSWindowsUpdate 模块设置保存到 XML 文件。
- Set-WUSettings: 配置 Windows 更新客户端设置。
- Update-WUModule:更新 PSWindowsUpdate 模块。
如何在 PowerShell 中检查可用的 Windows 更新
要在 PowerShell 中检查可用的 Windows 更新,请使用 PSWindowsUpdate 模块中提供的 Get-WindowsUpdate
cmdlet。
Get-WindowsUpdate
如何使用 PowerShell 安装所有可用的 Windows 更新
要在 PowerShell 中安装所有可用的 Windows 更新,请使用 PSWIndowsUpdate 模块中提供的 Install-WindowsUpdate
命令。
Install-WindowsUpdate -AcceptAll
上述 PowerShell 命令 Install-WndowsUpdate
使用参数 -AcceptAll
在 Windows 中安装所有更新。
安装 Windows 更新后,使用 PSWindowsUpdate
模块中提供的 Get-WURebootStatus 命令检查是否需要重新启动。
如何在 PowerShell 中删除 Windows 更新
您可以使用 PSWindowsUpdate 模块中提供的 PowerShell 命令 Remove-WindowsUpdate
来删除 Windows 更新。
Remove-WindowsUpdate -KBArticleID KB4601395
在上述 PowerShell 脚本中,Remove-WindowsUpdate
命令删除具有 KBArticleId KB4601395 的 Windows 更新。
如何在 PowerShell 中隐藏 Windows 更新
用于隐藏 Windows 更新的 PowerShell 命令是 Hide-WindowsUpdate
。
Hide-WindowsUpdate -KBArticleID KB4601395
此 PowerShell 命令 Hide-WindowsUpdate
使用参数 -KBArticleId
作为 KB4601395 来隐藏更新。
如何在 PowerShell 中查看 Windows 更新历史记录
要在 PowerShell 中查看 Windows 更新历史记录,请使用命令 Get-WUHistory
。
Get-WUHistory
上述 PowerShell 命令 Get-WUHistory
返回 Windows 更新列表以及 ComputerName、OperationName、Result、Date 和 Title。
酷提示:如何在 PowerShell 中获取最近 30 天的更新!
如何使用 PowerShell 列出可用更新
用于列出可用 Windows 更新的 PowerShell 命令是 Get-WUList
。
Get-WUList
此 PowerShell 命令返回当前计算机可用的更新列表。
要检查远程计算机上可用的 Windows 更新列表,请运行以下命令。
Get-WUList -Computer INCOR-EU-20
酷提示:如何使用 PowerShell 检查已安装的 Windows 更新!
结论
希望以上关于如何在PowerShell中使用PSWindowsUpdate
模块的文章对您有所帮助。
PSWindowsUpdate 模块提供用于管理 Windows 更新的 cmdlet。您可以了解有关用于管理软件包的 PackageManagement 模块的更多信息。
您可以在 ShellGeek 主页上找到有关 PowerShell Active Directory 命令和 PowerShell 基础知识的更多主题。
猜你还喜欢
- 03-30 [玩转系统] 如何用批处理实现关机,注销,重启和锁定计算机
- 02-14 [系统故障] Win10下报错:该文件没有与之关联的应用来执行该操作
- 01-07 [系统问题] Win10--解决锁屏后会断网的问题
- 01-02 [系统技巧] Windows系统如何关闭防火墙保姆式教程,超详细
- 12-15 [玩转系统] 如何在 Windows 10 和 11 上允许多个 RDP 会话
- 12-15 [玩转系统] 查找 Exchange/Microsoft 365 中不活动(未使用)的通讯组列表
- 12-15 [玩转系统] 如何在 Windows 上安装远程服务器管理工具 (RSAT)
- 12-15 [玩转系统] 如何在 Windows 上重置组策略设置
- 12-15 [玩转系统] 如何获取计算机上的本地管理员列表?
- 12-15 [玩转系统] 在 Visual Studio Code 中连接到 MS SQL Server 数据库
- 12-15 [玩转系统] 如何降级 Windows Server 版本或许可证
- 12-15 [玩转系统] 如何允许非管理员用户在 Windows 中启动/停止服务
取消回复欢迎 你 发表评论:
- 精品推荐!
-
- 最新文章
- 热门文章
- 热评文章
[影视] 黑道中人 Alto Knights(2025)剧情 犯罪 历史 电影
[古装剧] [七侠五义][全75集][WEB-MP4/76G][国语无字][1080P][焦恩俊经典]
[实用软件] 虚拟手机号 电话 验证码 注册
[电视剧] 安眠书店/你 第五季 You Season 5 (2025) 【全10集】
[电视剧] 棋士(2025) 4K 1080P【全22集】悬疑 犯罪 王宝强 陈明昊
[软件合集] 25年6月5日 精选软件22个
[软件合集] 25年6月4日 精选软件36个
[短剧] 2025年06月04日 精选+付费短剧推荐33部
[短剧] 2025年06月03日 精选+付费短剧推荐25部
[软件合集] 25年6月3日 精选软件44个
[剧集] [央视][笑傲江湖][2001][DVD-RMVB][高清][40集全]李亚鹏、许晴、苗乙乙
[电视剧] 欢乐颂.5部全 (2016-2024)
[电视剧] [突围] [45集全] [WEB-MP4/每集1.5GB] [国语/内嵌中文字幕] [4K-2160P] [无水印]
[影视] 【稀有资源】香港老片 艺坛照妖镜之96应召名册 (1996)
[剧集] 神经风云(2023)(完结).4K
[剧集] [BT] [TVB] [黑夜彩虹(2003)] [全21集] [粤语中字] [TV-RMVB]
[实用软件] 虚拟手机号 电话 验证码 注册
[资源] B站充电视频合集,包含多位重量级up主,全是大佬真金白银买来的~【99GB】
[影视] 内地绝版高清录像带 [mpg]
[书籍] 古今奇书禁书三教九流资料大合集 猎奇必备珍藏资源PDF版 1.14G
[电视剧] [突围] [45集全] [WEB-MP4/每集1.5GB] [国语/内嵌中文字幕] [4K-2160P] [无水印]
[剧集] [央视][笑傲江湖][2001][DVD-RMVB][高清][40集全]李亚鹏、许晴、苗乙乙
[电影] 美国队长4 4K原盘REMUX 杜比视界 内封简繁英双语字幕 49G
[电影] 死神来了(1-6)大合集!
[软件合集] 25年05月13日 精选软件16个
[精品软件] 25年05月15日 精选软件18个
[绝版资源] 南与北 第1-2季 合集 North and South (1985) /美国/豆瓣: 8.8[1080P][中文字幕]
[软件] 25年05月14日 精选软件57个
[短剧] 2025年05月14日 精选+付费短剧推荐39部
[短剧] 2025年05月15日 精选+付费短剧推荐36部
- 最新评论
-
- 热门tag