从 PowerShell 设置 Windows 更新首选项时出错 [英] Error when setting Windows Updates preferences from PowerShell

查看:39
本文介绍了从 PowerShell 设置 Windows 更新首选项时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试按照这里的建议(如何将 Windows 更新设置为从不使用 PowerShell 检查更新?),而且非常简单.一切似乎都在工作,直到我到达需要实际更改 NotificationLevel 值的部分.我收到以下错误:

异常设置NotificationLevel":来自HRESULT的异常:0x80240037"在行:1 字符:1+ $WUSettings.NotificationLevel=1+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : NotSpecified: (:) [], SetValueInvocationException+ FullQualifiedErrorId : CatchFromBaseAdapterSetValueTI

我尝试在另一台 Windows 7 Pro 计算机上运行相同的序列,但收到的错误消息略有不同:

异常设置NotificationLevel":来自HRESULT的异常:0x80240037"在行:1 字符:13+ $WU 设置.<<<<通知级别=1+ CategoryInfo : InvalidOperation: (:) [], RuntimeException+ FullQualifiedErrorId : PropertyAssignmentException

我注意到的唯一区别是我尝试在 Windows 7 Pro 而不是 Windows Server 2008 R2 上执行此操作.这是我第一次尝试使用 PowerShell,这看起来相当简单,但我现在很快就超出了我的深度.有什么建议吗?

I tried following the suggestion here(How do I set Windows Update to never check for updates with PowerShell?), and it's very straight forward. Everything seems to be working until I get to the part where I need to actually change the NotificationLevel value. I get the following error:

Exception setting "NotificationLevel": "Exception from HRESULT: 0x80240037" At line:1 char:1 + $WUSettings.NotificationLevel=1 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], SetValueInvocationException + FullyQualifiedErrorId : CatchFromBaseAdapterSetValueTI

I tried running the same sequence on another Windows 7 Pro computer and got a slightly different error message:

Exception setting "NotificationLevel": "Exception from HRESULT: 0x80240037" At line:1 char:13 + $WUSettings. <<<< NotificationLevel=1 + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : PropertyAssignmentException

The only difference that I noticed was that I'm trying to do this on Windows 7 Pro instead of Windows Server 2008 R2. This is my first venture into using PowerShell and this looked fairly simply, but I'm now quickly out of my depth. Any suggestions?

推荐答案

我在 2012 年的日志中发现了这个:

I found this in my logs from 2012 :

您可以尝试删除 :

HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU

<小时>

已编辑

我重现了您的问题,您只是忘记以管理员身份运行 PowerShell(高级模式):

I reproduce your problem, you just forget to run your PowerShell as administrator (elevated mode) :

对比

这篇关于从 PowerShell 设置 Windows 更新首选项时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆