在Powershell中一起格式化多个结果集

问题描述

Get-WmiObject -Class Win32_OperatingSystem -ComputerName (Get-Content "C:\Temp\Servers.txt") | SELECT-Object PSComputerName,@{Name="Memory (RAM in GB)";Expression={[Math]::Round($_.TotalVisibleMemorySize/1024/1024)}} | Format-Table
Get-WmiObject -Class Win32_logicaldisk -ComputerName (Get-Content "C:\Temp\Servers.txt") | Select-Object PSComputerName,DriveType,DeviceID,VolumeName,@{Name="Size";Expression={[math]::ceiling($_.Size /1GB)}},@{Name="FreeSpace";Expression={[math]::ceiling($_.FreeSpace /1GB)}},Compressed | where DriveType -eq 3 | Format-Table
Get-WmiObject -Class Win32_OperatingSystem -ComputerName (Get-Content "C:\Temp\Servers.txt")| Select-Object PSComputerName,BuildNumber,BuildType,Caption,CodeSet,OSArchitecture,SystemDrive,TotalVisibleMemorySize,Version | Format-Table
Get-WmiObject -Class win32_product -ComputerName (Get-Content "C:\Temp\Servers.txt") | Select-Object Name,Version,Vendor,InstallDate  | Format-Table
Get-WmiObject -Class Win32_Service -ComputerName (Get-Content "C:\Temp\Servers.txt") |  Select-Object  PSComputerName,DisplayName,StartName,PathName,StartMode| where DisplayName -Like "*xyz*" |Format-Table

到目前为止,我已经设法将以上内容拼凑在一起,以从服务器服务器中获取所需的信息,但是现在我想对其进行格式化,以便可以以我可以显示的格式整理每个服务器的信息

例如。

Server : ABC

RAM : 64 GB

Number of Processors : 8

Disk :
Table of disk Sizes Etc 

任何指针将不胜感激

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)