PSWindowsUpdate permits you to oversee Windows Update on any PC running PowerShell 2.0 or higher. This module even empowers Windows administrators to check for and introduce refreshes on far-off laptops and servers and it contains a set of the capability to check,download and introduce or eliminate updates from a nearby machine. PSWindowsUpdate is especially helpful for introducing reports on Server Center machines that have no GUI, or in cases, for example, Sysprep’s Review Mode where the Windows Update GUI doesn’t work. PSWindowsUpdate Module can be introduced physically by downloading the Compress document and concentrating in two spots:
- %USERPROFILE%DocumentsWindowsPowerShellModules
- %WINDIR%System32WindowsPowerShellv1.0Modules
- To import the module,
- PS > Import-Module PSWindowsUpdate
Accessible Capabilities
You can likewise involve the module’s capabilities in your contents without bringing in them. When the module is imported, you have the accompanying cmdlets available to you.
1. Add-WUOfflineSync: Register disconnected scanner administration
This capability permits you to introduce refreshes from a neighborhood store. You can work with either the old wsusscan.cab or the new wsusscn2.cab. If you have any desire to robotize the download of the Taxi document, you ought to take a gander at this PowerShell script.
2. Add-WUServiceManager: Empower shopping mode Microsoft update
3. Get-WUList: Get a rundown of accessible updates that meet specific measures
To get an outline of the accessible updates or to look for refreshes, this cmdlet will be useful.
4. Get-WUInstall: Download and introduce refreshes
This cmdlet is the center of the PowerShell module. It accompanies many boundaries. You can pick whether the updates are downloaded from your WSUS server or from Microsoft Update. You can indicate updates or classifications, arrange the reboot conduct, and do significantly more.
5. Eliminate WUOfflineSync: Unregister disconnected scanner administration
Assuming you enrolled in the disconnected scanner administration with Add-WUOfflineSync, you can utilize this capability to unregister the assistance.
6. Get-WUServiceManager: Show Administration Administrator design
At times you need to check which update administration is arranged on the PC (Windows Update, shopping mode Microsoft Update, WSUS, or disconnected sync administration).
7. Get-WUHistory: Get a rundown of past updates. You can list the introduced reports on either a nearby machine or a far-off one.
8. Get-WUInstallerStatus: Check Windows Update Installer status. This cmdlet checks that the Windows Installer is prepared. You should actually take a look at this toward the start of your content.
9. Get-WURebootStatus: Check Windows Update reboot status. You can involve this order in contents to decide whether a particular update requires a reboot.
10. Get-WUUninstall: Uninstall the update. This cmdlet accepts an updated ID as info and uninstalls the comparing update.
Advantage
The upside of PSWindowsUpdate over the two update order line devices “WuInstall and ABC-Update” is that you can undoubtedly coordinate PSWindowsUpdate’s capabilities in your PowerShell scripts. In the event that you work with another prearranging arrangement, you could lean toward one of the other two devices. PowerShell Eventing allows you to answer the nonconcurrent notices that many items support.
Understanding eventing from a significant level
As per the MSDN site, an occasion is “a message conveyed by an item to message the event of an activity”. All information contained in a PowerShell pipeline are items and it’s a good idea that these articles can send status messages for their own sake; this is “Eventing.” Here is the significant level work process for how Windows PowerShell eventing functions:
- Find the item occasion or occasions that you’re keen on observing.
- Buy into the occasion utilizing the proper Register-cmdlet.
- Occasionally check the occasion line automatically and design your result as suitable.
- Cleanse occasions from the line when you’re done.
We’ll utilize Windows The board Instrumentation (WMI) impermanent occasion memberships to record all cycle start and stop occasions. What’s more, we’ll make a brief occasion membership here, however, you can design super durable occasion memberships in the event that you need to. You’ll find that PowerShell specialists even made CLI and graphical front finishes for super durable occasion memberships!
Finding your picked object occasion
If any occasion your favorite Windows PowerShell/.NET items are uncovered by pipelining the article into Get-Part. Of the four inherent cycle occasions, the one in particular that sounds good to me promptly is Left, which fires when the interaction exits from its run space. prompt command we believe Windows PowerShell should shoot occasions when new cycles are begun. The WMI/Normal Data Model (CIM) archive stores this data. We basically have to apply a few examinations and a decent WMI Inquiry Language (WQL) question to bring our outcomes.
Buying into .NET occasions in Windows PowerShell
We can make memberships to three unique occasion types, and the Windows PowerShell group gave us a cmdlet for each sort:
- Register-ObjectEvent: Buy into .NET item occasions.
- Register-EngineEvent: Buy into PowerShell runtime occasions.
- Register-WmiEvent: Buy into Windows The board Instrumentation (WMI) object occasions.