简体   繁体   English

我想用 powershell 显示主板信息,但更改参数名称 output

[英]I want to show motherboard information with powershell but change a parameter name output

I want to rename Product: to Motherboard:我想将Product:重命名为Motherboard:

My code:我的代码:

Get-WmiObject win32_baseboard | Format-List Product,Manufacturer

Output: Output:

Product      : Nitro N50-600(DCH)
Manufacturer : Acer

You can rename the property in PowerShell with a calculated property expression :您可以使用计算的属性表达式重命名 PowerShell 中的属性:

Get-WmiObject win32_baseboard | Format-List @{Name='MotherBoard';Expression='Product'},Manufacturer

In this case, we're telling Format-List to calculate a new property Motherboard , the value of which it should take from the existing Product property在这种情况下,我们告诉Format-List计算一个新属性Motherboard ,它应该从现有的Product属性中获取值

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM