Summary: Use Windows PowerShell to change output object property names.
How can I use Windows PowerShell to change the property names of my output objects?
The easiest way to achieve this to use Select-Object and a calculated field:
Get-WmiObject -Class win32_OperatingSystem -ComputerName webr201 |
select @{N=’ComputerName’; E={$_.PSComputerName}},
@{N=’OS’; E={$_.caption}},
@{N=’SP’; E={$_.ServicePackMajorVersion}}
0 comments