I was executing below script to obtain the server patch version of Skype for business servers.
I need the output as server patch name, version and computername.
$x = Get-Content "E:empservers.txt"
foreach ($y in $x)
{
Invoke-Command -ComputerName $y -scriptblock {Get-WmiObject -query ‘select name, version from win32_product’ | where {$_.name -like “*Skype for Business server 2015, core*”}} | Select-object name, Version, @{Name='ComputerName';Expression={$y}} | ft -AutoSize
}
But I am receiving output as below
Name Version ComputerName
---- ------- ------------
Skype for Business Server 2015, Core Components 6.0.9319.598 D221412xxxxxx
Name Version ComputerName
---- ------- ------------
Skype for Business Server 2015, Core Components 6.0.9319.598 D221412xxxxxxxx
Name Version ComputerName
---- ------- ------------
Skype for Business Server 2015, Core Components 6.0.9319.598 D221412xxxxxx
Name Version ComputerName
---- ------- ------------
Skype for Business Server 2015, Core Components 6.0.9319.598 D221412xxxxxxx
Name Version ComputerName
---- ------- ------------
Skype for Business Server 2015, Core Components 6.0.9319.598 D221412xxxxxx
I don't need my header tiles in every line of output. Any suggestions?
question from:
https://stackoverflow.com/questions/65878997/get-wmiobject-to-combine-to-outputs 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…