I am using the PSWindowsUpdate Module and have successfully used the cmdlet to return Windows Updates which need installing on a server.

For example

Get-WindowsUpdate –ComputerName Server1

This then return the updates which need to be installed.

Now rather than run this individually for my servers, I want to scale this out so I can run the cmdlet against multiple servers at the same time.

I am looking for some advice on how to achieve this, I assume I would put the list of servers into a variable and possibly use the ForEach-Object

Any advice would be greatly appreciated

Invoke-Command -ComputerName (get-content c:\servers.txt) -ScriptBlock {get-windowsupdate}
put your servers in a text file in c:\servers.txt

Thanks for you reply robertrobert59. That failed to work but I adapted the code to this:

Invoke-Command { Get-WindowsUpdate -ComputerName $Servers }

I specified my servers in the variable $Servers

This has worked