Get-WmiObject命令行将文本添加到变量

时间:2016-08-18 11:37:11

标签: powershell get-wmiobject

这是正常运作的代码:

$Result1 = Get-WmiObject -Class Win32_Processor |

我想像这样“添加文字作为标签”:

$Result1 = "ADD TEXT AS LABEL" & Get-WmiObject -Class Win32_Processor |

非常感谢任何和所有建议。

1 个答案:

答案 0 :(得分:0)

使用子表达式:

$Result1 = $("ADD TEXT AS LABEL"; Get-WmiObject -Class Win32_Processor) | ...