# Get commands and whether one is needed to get disk size and memory usage added to list of computers

**URL:** <https://forums.powershell.org/t/get-commands-and-whether-one-is-needed-to-get-disk-size-and-memory-usage-added-to-list-of-computers/24659>\
**Category:** PowerShell Help\
**Created:** [August 29, 2024, 3:24pm UTC](https://forums.powershell.org/t/get-commands-and-whether-one-is-needed-to-get-disk-size-and-memory-usage-added-to-list-of-computers/24659 "2024-08-29T15:24:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevrms](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@stevrms](https://forums.powershell.org/u/stevrms)\
**Post date:** [August 29, 2024, 3:24pm UTC](https://forums.powershell.org/t/get-commands-and-whether-one-is-needed-to-get-disk-size-and-memory-usage-added-to-list-of-computers/24659/1 "2024-08-29T15:24:11Z")

</div>

Good morning and thank you. What I’ve been trying to do is I’m trying to create a query that can identify all computers that have a specific nomenclature involved to give me computer name IP address and this work

Get-ADComputer -fliter 'Name -like “_NAME_” -Properties IPV4Address | FT NAME, DNSHOSTNAME, IPV4Address -A

The problem comes in when I try to add a command that will also give me a specific drive space and the percentage of free space on that drive. Is there a way to add that ability to the command above so that I can also include that the specific drive data?

 ![Screenshot_20240829-104309](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/2X/e/e383d3f2736f9a540acedb5ba177d2ed1aa2c9c7.jpeg)

To be entirely honest even if I can just pull the above picture that could work as well but I’ve only been able to get either the size or the free space I haven’t been able to combine the two in any command yet. Beyond that add it to my query.

---

<div class="post-metadata">

**Author:** ![neemobeer](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/neemobeer/32/4087_2.png) [@neemobeer](https://forums.powershell.org/u/neemobeer)\
**Post date:** [August 29, 2024, 3:58pm UTC](https://forums.powershell.org/t/get-commands-and-whether-one-is-needed-to-get-disk-size-and-memory-usage-added-to-list-of-computers/24659/2 "2024-08-29T15:58:38Z")

</div>

You don’t show any code related to disk space, do you have code you can show? Working on assumptions here, but you can specify a -DriveLetter if you want a specific drive or just loop through all available volumes since all are returned by default from `Get-Volume`

---

<div class="post-metadata">

**Author:** ![stevrms](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@stevrms](https://forums.powershell.org/u/stevrms)\
**Post date:** [August 30, 2024, 6:10pm UTC](https://forums.powershell.org/t/get-commands-and-whether-one-is-needed-to-get-disk-size-and-memory-usage-added-to-list-of-computers/24659/3 "2024-08-30T18:10:29Z")

</div>

Not sure what code you need, with Get-Volume I can’t get it to go where I gaet all the computers that end in a specific nomenclature to show remotely. Like for example all computers on my network that end in _old_ I’d like to get all their volume sizes first and foremost but then add in IPs and so forth.

---

<div class="post-metadata">

**Author:** ![grey0ut](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/grey0ut/32/5310_2.png) [@grey0ut](https://forums.powershell.org/u/grey0ut)\
**Post date:** [August 31, 2024, 12:39am UTC](https://forums.powershell.org/t/get-commands-and-whether-one-is-needed-to-get-disk-size-and-memory-usage-added-to-list-of-computers/24659/4 "2024-08-31T00:39:10Z")

</div>

it sounds like you’re trying to make a great big one-liner when instead you should be writing a script.  
You’ll need a way to handle errors for computers returned from AD that aren’t reachable via Get-Volume.  
I suggest storing your AD computers in a variable then looping through that with a try/catch block and then maybe outputting a PSCustomobject with the properties you want

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [September 30, 2024, 12:39am UTC](https://forums.powershell.org/t/get-commands-and-whether-one-is-needed-to-get-disk-size-and-memory-usage-added-to-list-of-computers/24659/5 "2024-09-30T00:39:46Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
