Asked by:
PowerShell Windows Update Module

Question
-
Hi Scripting Guys,
I want to write a PowerShell script to manage scheduled, unattended Windows Updates without any GUI activity. I use Windows 10 Home, 64-bit, Ver. 1803 on a Lenovo Ideapad 300 laptop with PowerShell v. 5.1.
I am inexperienced in both scripting and PowerShell, and although I am slowly working my way through two books, Windows Powershell and Powershell Scripting, both by Don Jones and Jeffery Hicks (Series: Learn in a Month of Lunches – Manning Pub.), I do have some time limits on the task - apart from being 82 years old.
Question 1: Kari Finn, in Windows 10 Forum tutorial “Update and Upgrade Windows 10 using PowerShell”, 19 Mar 2018, requires that PSWindowsUpdate.zip be extracted only to \System32\WindowsPowerShell\v1.0\Modules, whereas Michel Gadja in the Technet repository requires extraction also to \Documents\WindowsPowerShell\Modules. I followed the W10 Forum requirement, and I always run PowerShell as Administrator (console, not ISE), and have only one User Account (Administrator) in any case, but may add a standard user account for stronger security for routine applications.
Should I also extract the zip folder to a standard User\Documents\...\ folder regardless, and work from there?
Question 2: I do not fully understand the output of the cmdlet Get-WUServiceManager, in particular the meaning, in context, of the two parameters, IsManaged and IsDefault. I assume that a True value for the latter means that the corresponding GUID/s identify the currently wanted WU source/s from the list of those available to my computer. I have no idea what IsManaged is about and I cannot find an explanation anywhere, so I have been experimenting with the cmdlets Get-, Add- and Remove-WUServiceManager, confining the ServiceID to the known GUID (from the Windows 10 Forum tutorial) to add or remove other Microsoft products. Unfortunately, I did not have the foresight to copy the Get- output before experimenting, so I have no record of the initial state before I started. I am puzzled by the fact that the logical value for IsDefault for Microsoft Update is False when I add that source. Perhaps the Add- cmdlet needs an additional phrase to set IsDefault to True, but I would need advice on the syntax. I should point out that so far, none of my trials have occurred in the presence of real live updates; that will be a later phase.
My second question therefore has four parts which follow immediately. Please read in conjunction with the cmdlet outputs which I summarise further below.
- Can you please explain the purpose and usage of the parameters IsManaged and IsDefault, or point me to an online or other reference that does?
- Is it the case that multiple sources are legitimate, i.e., that Windows Update and Microsoft Update sources can be default True simultaneously? (I assume that would need to be the case.)
- If my output results (below) indicate a problem, how do I fix it? (E.g., what is the syntax for the Add- cmdlet, if that is the solution?)
- Where can I find a published list of all possible update sources and their GUIDs (just to satisfy my curiosity).
Output Results of Get-WUServiceManager
The following results were obtained during one continuous PowerShell session. The Add- and Remove- cmdlets are omitted for brevity. No error messages occurred. The initial record was obtained after one, or more, earlier computer sessions when Microsoft Update was added.
ServiceID IsManaged IsDefault Name
Relevant GUID False False Microsoft Update
Relevant GUID False False DCat Flighting Prod
Relevant GUID False False Windows Store (DCat Prod)
Relevant GUID False True Windows Update
Remove Microsoft Update
ServiceID IsManaged IsDefault Name
Relevant GUID False False DCat Flighting Prod
Relevant GUID False False Windows Store (DCat Prod)
Relevant GUID False True Windows Update
Add Microsoft Update
ServiceID IsManaged IsDefault Name
Relevant GUID False False Microsoft Update
Relevant GUID False False DCat Flighting Prod
Relevant GUID False False Windows Store (DCat Prod)
Relevant GUID False True Windows Update
Note 1: IsDefault is never True for Microsoft Update.
Note 2:IsManaged is always False for all.
I would be most grateful if you can enlighten me re the above questions.
Thank you.
Kevin Seers
- Moved by Bill_Stewart Thursday, December 13, 2018 3:16 PM This forum is not a step-by-step training forum
Tuesday, September 18, 2018 6:37 AM
All replies
-
Sorry but this is not a free personal training forum. Please review the following for learning resources and pre-written scripts.
Also ask questions about online tutorials on the tutorial site. WindowsUpdate is not a Microsoft module. Post questions to the author of the module.
Please carefully review the following links to set your expectation for posting in technical forums.
This Forum is for Scripting Questions Rather than script requests
- Script Gallery.
- Script Center
- Script requests
- Posting guidelines
- Handy tips for posting to this forum
- How to ask questions in a technical forum
- Rubber duck problem solving
- How to write a bad forum post
- Help Vampires: A Spotter's Guide
- This forum is for scripting questions rather than script requests
\_(ツ)_/
Tuesday, September 18, 2018 6:50 AM