Powershell ISE Module: Installing PSWindowsUpdate, Script: Provisioning Get-PendingReboot
From another Post we discussed accessing the Repository PowerShell Gallery | PSWindowsUpdate 1.5.2.2
Using Module “PowerShellGet” Find and Install “PSWindowsUpdate” in “PSGallery”.
PowerShell Gallery | PSWindowsUpdate 1.5.2.2
PowerShell ISE, run as an Administrator, is an excellent way to see all that is offered in Modules.
This is one of the main reasons for requiring this Module from another Post when sorting out Windows Update problems:
PS C:\> Get-WUServiceManager (PSWindowsUpdate Module)
ServiceID IsManaged IsDefault Name
——— ——— ——— —-
7971f918-a847-4430-9279-4a52d1efe18d False True Microsoft Update
8b24b027-1dee-babb-9a95-3517dfb9c552 False False Windows Store (DCat Flighting Prod) (For W 10.0 ONLY)
855e8a7c-ecb4-4ca3-b045-1dfa50104289 False False Windows Store (DCat Prod) (For W 8.0 or LATER)
9482f4b4-e343-43b6-b170-9a65bc822c77 False False Windows Update
You may need to add one or more of the above with Add-WUServiceManager
To better understand Windows Update Service Manager, refer to the Following:
AddServiceFlag enumeration
https://msdn.microsoft.com/en-us/library/windows/desktop/bb394819%28v=vs.85%29.aspx
IUpdateServiceManager2::AddService2 method
https://msdn.microsoft.com/en-us/library/windows/desktop/bb394829%28v=vs.85%29.aspx
I don’t use Windows Update GUI unless I absolutely need to. I do all of my MU/WU activity using “PSWindowsUpdate”. I can “Get WUList”, “Get-WUInstall”, etc. I definitely like this way much better and it gives the control over a Narly process like WU.
Now we need to Provision Script Get-PendingReboot. Because TechNet’s Script Center is not a Formal Official Repository, there is no way that I have found to “Install” from there. So one needs to do and end run around in effect by putting it in a Directory somewhere(I put mine in the appropriate Directory under the Windows Directory.
Powershell, VB Script, SQL and JavaScript – TechNet IT Pro’s and Scripting Guys
TechNet Script Get-PendingReboot – Query Computer(s) For Pending Reboot State
Then in PowerShell ISE, run as an Administrator, on the top Menu Bar>>File>>the Directory path to where you put Get-PendingReboot.ps1 and Click on it.
Now you have the Script open. On that same Menu Bar you should see a side ways triangle. If you hover over it it says “Run Script”, Click it. If you Click on “Refresh” on the Right Side and Search you should find “Get-PendingReboot.ps1” and “Get-PendingReboot”(Click on this one) then Click to Run:
Get-PendingReboot
Now to get this again, Open ‘File’ again at your next session and you will see “Get-PendingReboot.ps1” Path at the bottom. Click it>>Run Arrow>>Refresh>>Search ‘Get-pe’>>Get-PendingReboot:
Computer :
CBServicing : False
WindowsUpdate : False
CCMClientSDK :
PendComputerRename : False
PendFileRename : False
PendFileRenVal :
RebootPending : False
The reason why I like this one so much is the Detail picture you has of your system. Sometimes there will be a ‘True’ there because of left over in the Temp Directory which need to be cleaned up so they don’t cause a problem!
I do not know anything else that gives these Details.
--------------------------------------
1. Tower Totals: 2xSSD ~512GB, 2xHHD 20 TB, Memory 32GB
SSDs: 6xOS Partitions, 2xW8.1 Main & Test, 2x10.0 Test, Pro, x64
CPU i7 2600 K, SandyBridge/CougarPoint, 4 cores, 8 Threads, 3.4 GHz
Graphics Radeon RX 580, RX 580 ONLY Over Clocked
More perishable
2xMonitors Asus DVI, Sony 55" UHD TV HDMI
1. NUC 5i7 2cores, 4 Thread, Memory 8GB, 3.1 GHz, M2SSD 140GB
1xOS W8.1 Pro, NAS Dependent, Same Sony above.
-----------------