# Combing 2 scripts

**URL:** <https://forums.powershell.org/t/combing-2-scripts/20169>\
**Category:** PowerShell Help\
**Created:** [August 15, 2022, 7:08pm UTC](https://forums.powershell.org/t/combing-2-scripts/20169 "2022-08-15T19:08:43Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [August 15, 2022, 7:19pm UTC](https://forums.powershell.org/t/combing-2-scripts/20169/2 "2022-08-15T19:19:16Z")

</div>

Chad,  
Welcome to the forum. 👋🏽

The most common way of combining the results of more than one query is to use a `[PSCustomObject]`.

```auto
$InputComputerList = Get-Content -Path 'C:\Data\GetDescription\ComputerList.txt'
$Result =
foreach ($ComputerName in $InputComputerList) {
    $ADComputer = Get-ADComputer -Identity $ComputerName -Properties Description
    [PSCustomObject]@{
        Name = $ADComputer.Name
        Description = $ADComputer.Description
        Online = Test-Connection -ComputerName $ComputerName -Count 1 -Quiet
    }
}
$Result

```

Of course you can pipe the `$Result` to whatever further step you want. 😉

---

_[View the full topic](https://forums.powershell.org/t/combing-2-scripts/20169)._
