Giter VIP home page Giter VIP logo

pswindowsupdate's People

Contributors

mgajda83 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pswindowsupdate's Issues

Get-WUOfflineMSU : Specified argument was out of the range of valid values

Cannot use Get-WUOfflineMSU no matter what parameters I use, even if I copy exactly the example. Please see the information below as well as the screenshot

ps_err

PS C:\Users\WDAGUtilityAccount> Get-WUOfflineMSU -KBArticleID "KB5031539" -Destination "C:\Temp" -Debug
DEBUG: 5/31/2024 5:37:37 PM CmdletStart: Get-WUOfflineMSU
DEBUG: 5/31/2024 5:37:38 PM http://www.catalog.update.microsoft.com/Search.aspx?q=KB5031539
VERBOSE: Found [6] Updates in Microsoft Update Catalog
DEBUG: 5/31/2024 5:37:40 PM Show update to accept: 2023-10 Servicing Stack Update for Windows 10 Version 22H2 for ARM64-based Systems (KB5031539)
DEBUG: 5/31/2024 5:37:43 PM Accepted
DEBUG: 5/31/2024 5:37:43 PM [{"uidInfo":"5365a46b-703d-476b-9263-93e956e08de8","updateID":"5365a46b-703d-476b-9263-93e956e08de8","size":0}]
Get-WUOfflineMSU : Specified argument was out of the range of valid values.
Parameter name: i
At line:1 char:1

  • Get-WUOfflineMSU -KBArticleID "KB5031539" -Destination "C:\Temp" -Deb ...
  •   + CategoryInfo          : NotSpecified: (:) [Get-WUOfflineMSU], ArgumentOutOfRangeException
      + FullyQualifiedErrorId : System.ArgumentOutOfRangeException,PSWindowsUpdate.GetWUOfflineMSU
    
    

pulling from WSUS instead of MS

I searched the repo for 'wsus' and only found reference to the wsusscn2.cab file (which I don't think is really related to using WSUS instead of the MS source for updates...

Is there a way to choose the source for the updates?

Import Module issue

PS C:\WINDOWS\system32> import-module -name PSWindowsUpdate
import-module : Could not find a part of the path 'C:\Users\User\AppData\Local\Temp\tmpEXO_smhylu1m.qnz\exchange.format.ps1xml'.
At line:1 char:1

  • import-module -name PSWindowsUpdate
  •   + CategoryInfo          : ObjectNotFound: (:String) [Import-Module], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.ImportModuleCommand
    

Install-WindowsUpdate via Remote Call fails due to insufficient permissions

Our Powershell script operates from a central machine and cycles thru a bunch of virtual machines (Win2019, Win2022) in order to install the existing Windows updates using cmdlet "Install-WindowsUpdate".

eg.
.....
$Computer="SRV37V162"
Invoke-Command -ComputerName ($Computer) {Install-WindowsUpdate -ForceInstall -Verbose -AcceptAll}
.....

However, this results in the following error:

VERBOSE: Accepted [1] Updates ready to Download
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
+ CategoryInfo : NotSpecified: (:) [Get-WindowsUpdate], UnauthorizedAccessException
+ FullyQualifiedErrorId : System.UnauthorizedAccessException,PSWindowsUpdate.GetWindowsUpdate
+ PSComputerName : SRV37V162

The Powershell is executed with Administrator privileges.

Jochen Eckwerth
Kaufmännische Krankenkasse
Hannover

Request - InstallAtShutdown Parameter

Could you add a parameter that sets the InstallAtShutdown registry key when "Reboot Required" is found?

This way we do not need to AutoReboot. We can just set the InstallAtShutdown and allow the users to have the updates automatically happen.

Cannot remove UseWUServer with Set-WUSettings

Hi!

I'm able to enable WU server use, but cannot understand how to clear it back.

Set-WUSettings -UseWUServer

Confirm
Are you sure you want to perform this action?
Performing the operation "(12/03/2024 19:21:48) Set Windows Update settings" on target "XXXXXXX".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y

ComputerName UseWUServer
------------ -----------
XXXXXXX           True
Set-WUSettings -UseWUServer False
Set-WUSettings: A positional parameter cannot be found that accepts argument 'False'.
Set-WUSettings -UseWUServer 0
Set-WUSettings: A positional parameter cannot be found that accepts argument '0'.
Set-WUSettings -UseWUServer ''
Set-WUSettings: A positional parameter cannot be found that accepts argument ''.

Could you please advise how to use this script? Thanks!

Get-WindowsUpdate : Value does not fall within the expected range.

PS C:\Program Files\Windows Defender> Get-WindowsUpdate -MicrosoftUpdate -Verbose -Download -AcceptAll -Install -Debug
DEBUG: 2/21/2024 2:25:33 PM CmdletStart: Get-WindowsUpdate
DEBUG: 2/21/2024 2:25:39 PM ParameterSetName: MicrosoftUpdate
DEBUG: 2/21/2024 2:25:39 PM Set pre search criteria: IsInstalled = 0
DEBUG: 2/21/2024 2:25:39 PM Set pre search criteria: IsHidden = 0
DEBUG: 2/21/2024 2:25:39 PM Search criteria is: IsInstalled = 0 and IsHidden = 0
DEBUG: 2/21/2024 2:25:39 PM CYGNUSX1: Connecting...
DEBUG: 2/21/2024 2:25:40 PM Module version: 2.2.1.4
DEBUG: 2/21/2024 2:25:40 PM Dll version: 2.2.1.4
DEBUG: 2/21/2024 2:25:40 PM UpdateSessionObj mode: Local
DEBUG: 2/21/2024 2:25:40 PM ServiceManagerObj mode: Local
DEBUG: 2/21/2024 2:25:40 PM Set source of updates to Microsof Update
DEBUG: 2/21/2024 2:25:40 PM Search for ServiceID. Set source of updates to Microsoft Update
VERBOSE: CYGNUSX1 (2/21/2024 2:25:40 PM): Connecting to Microsoft Update server. Please wait...
VERBOSE: Found [5] Updates in pre search criteria
DEBUG: 2/21/2024 2:25:51 PM Update for Microsoft Defender Antivirus antimalware platform - KB4052623 (Version 4.18.24010.12) - Current Channel (Staged)
DEBUG: 2/21/2024 2:25:51 PM Update was not filtered
DEBUG: 2/21/2024 2:25:51 PM Security Intelligence Update for Microsoft Defender Antivirus - KB2267602 (Version 1.405.391.0) - Current Channel (Broad)
DEBUG: 2/21/2024 2:25:51 PM Update was not filtered
DEBUG: 2/21/2024 2:25:51 PM Realtek - Net - 1153.13.420.2023
DEBUG: 2/21/2024 2:25:51 PM Update was not filtered
Get-WindowsUpdate : Value does not fall within the expected range.
At line:1 char:1

  • Get-WindowsUpdate -MicrosoftUpdate -Verbose -Download -AcceptAll -Ins ...
  •   + CategoryInfo          : NotSpecified: (:) [Get-WindowsUpdate], ArgumentException
      + FullyQualifiedErrorId : System.ArgumentException,PSWindowsUpdate.GetWindowsUpdate
    
    
    

PS C:\Program Files\Windows Defender>

Get Driver updates from Microsoft Update

Before all, excellent job with this script @mgajda83 .

I've noticed there are some new driver releases on Microsoft Update Catalog (https://www.catalog.update.microsoft.com/Home.aspx) for my wireless adapter (Intel AX211 currently with driver release 22.40) but the script is not showing any of them. Is this supported?

Looking MS Update Catalog by searching for the Hardware Id of my wireless adapter I see lot of new drivers:

PS C:\windows\system32> Get-PnpDeviceProperty -InstanceId "PCI\VEN_8086&DEV_02F0&SUBSYS_00708086&REV_00\3&11583659&0&A3" | Format-Table -AutoSize
 
InstanceId                                                   KeyName                                        Type       Data
----------                                                   -------                                        ----       ----
PCI\VEN_8086&DEV_02F0&SUBSYS_00708086&REV_00\3&11583659&0&A3 DEVPKEY_Device_DeviceDesc                      String     Intel(R) Wi-Fi 6 AX201 160MHz
PCI\VEN_8086&DEV_02F0&SUBSYS_00708086&REV_00\3&11583659&0&A3 DEVPKEY_Device_HardwareIds                     StringList {**PCI\VEN_8086&DEV_02F0&SUBSYS_00708086**&REV_00, PCI\VEN_8086&DEV_02F0&SUBSYS_00708086, PCI\VEN_8086&DEV_02F0&CC_028000, PCI\VEN_8086&DEV_02F0&CC_0280}

And now entering the HiD in MS Update Catalog I get this:

image

image

image

Even in the case the will update look for the vendor (Lenovo in my case), adding "lenovo" to the search field shows only them. Which criterias use this PS script to search for updated drivers on MU?

image

image

Running Updates via SSH

I connected via SSH on my remote clients and tried to update the system. While Reading

Get-WUList

works, the installation of given update don't:

Get-WindowsUpdate -KBArticleID KB5034441 -Hide -Verbose

After questioned if I want to execute the upgrade the script fails with permission issues:

Get-WindowsUpdate : COM001: You don't have permission to perform this task.
In Zeile:1 Zeichen:1
+ Get-WindowsUpdate -KBArticleID KB5034441 -Hide -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-WindowsUpdate], Exception
    + FullyQualifiedErrorId : 0x80240044,PSWindowsUpdate.GetWindowsUpdate

Since the SSH Connection is estabilshed via admin-authorized keys I already thought I have elevated rights.

Having trouble with PSRemoting commands for PSWindowsUpdate

The command seems to accept and download email but not install or autoreboot. If I run it directly from the console it does work though:

Invoke-Command -ComputerName $Server -ScriptBlock {Install-WindowsUpdate -Install -AcceptAll -SendReport -AutoReboot -SendHistory -ScheduleJob (get-date).AddMinutes(1) }

The issue may be in the way I am attempting to run it? Perhaps I am missing something?

You did an update today? What's new? Thanks for an awesome module you have my deepest gratitude & respect!

Object reference not set to an instance of an object.

Since several weeks I am not able anymore to install new updates. It always fails with the error: 'Object reference not set to an instance of an object'.
Does anyone know how to fix this. I have uninstalled and reinstalled PSWindowsUpdate but without success.

As an example todays full verbose output is:

VERBOSE: PC (18.05.2024 09:37:48): Connecting to Microsoft Update server. Please wait...
VERBOSE: Found [1] Updates in pre search criteria
VERBOSE: Found [1] Updates in post search criteria
Get-WindowsUpdate: Something goes wrong: Cumulative Update for Windows 11 Insider Preview (10.0.22635.3640) (KB5037867); Object reference not set to an instance of an object.
Get-WindowsUpdate: Something goes wrong: Cumulative Update for Windows 11 Insider Preview (10.0.22635.3640) (KB5037867); Object reference not set to an instance of an object.

X ComputerName Result KB Size Title


VERBOSE: Accepted [0] Updates ready to Download
VERBOSE: Downloaded [0] Updates ready to Install
VERBOSE: Installed [0] Updates

Compiled Code Source

Are you willing to put up the source code for the compiled portion of this code base. It would certainly help as community members and I have often wondered about it.

Sendreport mail contains only the updates of the last server of a list of -computername

Hello
Good work with this module :-)
Here is a little bug that I found.

I executed this command
get-wulist -ComputerName srv-infor-app1,int-infor-app1,dev-infor-app1 -WindowsUpdate -SendReport -PSWUSettings @{SmtpServer="smtp.xxxx.xx";From="[email protected]";To="[email protected]"} -Verbose

The updates are listed in the console
image

I receive the mail, but only the updates of the last server in the list are listed

image

My configuration :

PS C:> $psversiontable

Name Value


PSVersion 5.1.19041.3570
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.3570
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

PS C:> Get-Module PSWindowsUpdate

ModuleType Version Name ExportedCommands


Binary 2.2.1.3 PSWindowsUpdate {Add-WUServiceManager, Enable-WURemoting, Get-WindowsUpdate, Get-W...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.