Powershell to install failed windows updates.

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?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Michael B. SmithManaging ConsultantCommented:
what is the error?
WellingtonISAuthor 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
At line:1 char:1
+ Invoke-WUInstall -ComputerName xxx -Script {ipmo PSWindowsUpda ...
+ ~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Invoke-WUInstall:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
Michael B. SmithManaging ConsultantCommented:
This implies that you may have downloaded the module, but you didn't actually install it.

What was your process?
WellingtonISAuthor Commented:
Interesting because it shows up.  What's the command to install it?
Michael B. SmithManaging ConsultantCommented:
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/
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.