0

This is the functioning code:

$Result1 = Get-WmiObject -Class Win32_Processor |

I would like to "ADD TEXT AS LABEL" like this:

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

Any and all suggestions greatly appreciated.

  • Label how? As in a table with a label above? Or add text front of the result of the WMIObject? – Jakodns Aug 18 '16 at 11:45
  • `"ADD TEXT AS LABEL" + (Get-WmiObject -Class Win32_Processor)` – sodawillow Aug 18 '16 at 11:55
  • Even text in front would be confusing; in front of which property? There's an empty pipeline at the end, what happens after that? And because it's there, the concatenation operator is `+`, `&` is the call operator. – Chris Dent Aug 18 '16 at 11:55

1 Answers1

0

Use a subexpression:

$Result1 = $("ADD TEXT AS LABEL"; Get-WmiObject -Class Win32_Processor) | ...
Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328