I'm trying to combine certain properties of the WMI classes PageFileSetting and PageFileUsage into one collection of some sort that will allow me to output the entire collection on the display, as follows:
[array]$PageFiles = gwmi -Class win32_PageFileSetting -ComputerName $server |
Select-Object -Property `
@{L = 'Name'; E = {$_.Name}},
@{L = 'Size'; E = {$_.MaximumSize}}
[array]$PFUsage = gwmi -Class win32_PageFileUsage -ComputerName $server |
Select-Object -Property `
@{L = 'Current Usage(gb)'; E = {$_.CurrentUsage}},
@{L = 'Peak Usage(gb)'; E = {$_.PeakUsage}}
The result I'm looking for would be this:
Name Size Current Usage Peak Usage
---- ---- ------------- ----------
c:\pagefile.sys 16 15
15
d:\pagefile.sys 12288 1365 1365
e:\pagefile.sys 4096 1140 1386
f:\pagefile.sys 4096 1096 1358
h:\pagefile.sys 6144 1132 1377
However, I have been unable to figure out how to combine them, or exactly what object or otherwise 'entity' to combine them into, that would allow them to be displayed together across the screen as shown. Can anyone help p