# Get-WindowsUpdate

**URL:** <https://forums.powershell.org/t/get-windowsupdate/14077>\
**Category:** PowerShell Help\
**Created:** [April 2, 2020, 4:00am UTC](https://forums.powershell.org/t/get-windowsupdate/14077 "2020-04-02T04:00:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![garytootell](https://avatars.discourse-cdn.com/v4/letter/g/ce73a5/32.png) [@garytootell](https://forums.powershell.org/u/garytootell)\
**Post date:** [April 2, 2020, 4:00am UTC](https://forums.powershell.org/t/get-windowsupdate/14077/1 "2020-04-02T04:00:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![robertrobert](https://avatars.discourse-cdn.com/v4/letter/r/9f8e36/32.png) [@robertrobert](https://forums.powershell.org/u/robertrobert)\
**Post date:** [April 2, 2020, 4:17am UTC](https://forums.powershell.org/t/get-windowsupdate/14077/2 "2020-04-02T04:17:38Z")

</div>

> Invoke-Command -ComputerName (get-content c:\servers.txt) -ScriptBlock {get-windowsupdate}

put your servers in a text file in c:\servers.txt

---

<div class="post-metadata">

**Author:** ![garytootell](https://avatars.discourse-cdn.com/v4/letter/g/ce73a5/32.png) [@garytootell](https://forums.powershell.org/u/garytootell)\
**Post date:** [April 3, 2020, 5:38am UTC](https://forums.powershell.org/t/get-windowsupdate/14077/3 "2020-04-03T05:38:49Z")

</div>

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

&nbsp;

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:30pm UTC](https://forums.powershell.org/t/get-windowsupdate/14077/4 "2024-05-16T20:30:00Z")

</div>

Closed on May 16, 2024, 8:30pm UTC


