Powershell to install failed windows updates.

WellingtonIS
WellingtonIS used Ask the Experts™
on
I just downloaded PSwindowsupdate and WUInstall modules.  I want to be able to install windowsupdates on remote machines without rebooting them.  The updates are already on the machine from WSUS or they can be downloaded from there.  I'm looking for commands to accomplish this so I can install updates on machines that have failed updates.

I've started with this but I don't think it's doing anything: Invoke-WUInstall -ComputerName xxx -Script {ipmo PSWindowsUpdate; Get-WUInstall -AcceptAll but the Invoke command is failing?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Michael B. SmithManaging Consultant

Commented:
what is the error?

Author

Commented:
Invoke-WUInstall : The term 'Invoke-WUInstall' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ Invoke-WUInstall -ComputerName xxx -Script {ipmo PSWindowsUpda ...
+ ~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Invoke-WUInstall:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
Michael B. SmithManaging Consultant

Commented:
This implies that you may have downloaded the module, but you didn't actually install it.

What was your process?

Author

Commented:
Interesting because it shows up.  What's the command to install it?
Michael B. SmithManaging Consultant

Commented:
What do you mean "it shows up"?

On Windows PowerShell 5.1, you should be able to simply "Install-Module PSWindowsUpdate" from an elevated PowerShell session. What is your Windows version and PowerShell version?

You can optionally just create the cmdlet yourself, from source: https://www.powershellgallery.com/packages/PSWindowsUpdate/1.5.2.2/Content/Invoke-WUInstall.ps1

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial