[英]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.