# Computer information problem

**URL:** <https://forums.powershell.org/t/computer-information-problem/8842>\
**Category:** PowerShell Help\
**Created:** [June 15, 2017, 2:14pm UTC](https://forums.powershell.org/t/computer-information-problem/8842 "2017-06-15T14:14:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![russ29210](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@russ29210](https://forums.powershell.org/u/russ29210)\
**Post date:** [June 15, 2017, 2:14pm UTC](https://forums.powershell.org/t/computer-information-problem/8842/1 "2017-06-15T14:14:47Z")

</div>

I am trying to get computer information from remote computers using the following. However, it errors out. Maybe someone can point me in the right direction or tell me what I am doing wrong.

$computers = Get-Content -Path “list.txt”  
Get-WmiObject -Class Win32\_ComputerSystem $computers  
Pause

This is the error:

Get-WmiObject : Invalid query "Select Computer 1, computer 2, Etc.

It does list all the computers from the list.txt file.

---

<div class="post-metadata">

**Author:** ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)\
**Post date:** [June 15, 2017, 2:24pm UTC](https://forums.powershell.org/t/computer-information-problem/8842/2 "2017-06-15T14:24:53Z")

</div>

You need to use parameter names for everything - as-is, they’re not in the right order, which is easy to do when you don’t use the names.

Get-WmiObject -Class Win32\_ComputerSystem -ComputerName $computers

What you’re doing is providing $computers as part of the query string, which isn’t correct.

---

<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:38pm UTC](https://forums.powershell.org/t/computer-information-problem/8842/3 "2024-05-16T20:38:36Z")

</div>


