Here’s the Powershell module for Windows Update. As per instruction on package page we install,
PS > Install-Module -Name PSWindowsUpdate
Install update example is below. Please note that I had to confirm which actions I wanted to confirm.
PS > Install-WindowsUpdate Are you sure you want to perform this action? Performing the operation "2018-07 Cumulative Update for Windows 10 Version 1803 for x64-based Systems (KB4340917)[86GB]" on target "FFTSys". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y Are you sure you want to perform this action? Performing the operation "Microsoft Silverlight (KB4013867)[13MB]" on target "FFTSys". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): N X ComputerName Result KB Size Title - ------------ ------ -- ---- ----- 1 FFTSys Accepted KB4340917 86GB 2018-07 Cumulative Update for Windows 10 Version 1803 for x64-based Systems (KB4340917) 1 FFTSys Rejected KB4013867 13MB Microsoft Silverlight (KB4013867) 2 FFTSys Downloaded KB4340917 86GB 2018-07 Cumulative Update for Windows 10 Version 1803 for x64-based Systems (KB4340917) 3 FFTSys Installed KB4340917 86GB 2018-07 Cumulative Update for Windows 10 Version 1803 for x64-based Systems (KB4340917) Reboot is required.Do it now? [Y / N] (default is 'N') Y
If you want to script it then you have to set to use a default action instead of interactively confirming.
Hide Windows Update example,
PS > Hide-WindowsUpdate -Title "Microsoft Silverlight*" -Hide Are you sure you want to perform this action? Performing the operation "Hide Microsoft Silverlight (KB4023307)[13MB]" on target "FFTSys". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): A ComputerName Status KB Size Title ------------ ------ -- ---- ----- FFTSys ---H-- KB4023307 13MB Microsoft Silverlight (KB4023307)