Not even sure if i am describing this right. But basically i want to take a query and this can be any query into a ForEach loop. But the caveat is the query needs to separate one part of the variable and those alike into separate tables.
Example:
Powershell
$Servers=Get-ContentC:\SomeLocation.txt
Powershell
$NICs=Get-WmiObject-ClassWin32_OperatingSystem-ComputerName$Server-ErrorActionStop
Powershell
foreach($NICin$NICs){
Powershell
$qName=$NIC.Caption
Powershell
$qBuild=$NIC.BuildNumber
In this instance I would like to match all Server 2012 w/ ComputerName in Table1
match all Server 2008R2 w/ ComputerName in Table 2. etc, etc.
Full code is something like this:
Powershell
$headerNames2|foreach{
Powershell
$tableEntry2+=""Powershell$NICs=Get-WmiObject-ClassWin32_OperatingSystem-ComputerName$Server-ErrorActionStop
...