How to express array values properly within a ConvertTo-Html line? This topic contains 2 replies, has 2 voices, and was last updated by Poseyj 1 year, 11 months ago. Author Posts August 18, 2015 at 9:41 am #28721 PoseyjParticipant $test = "PC1", "PC2", "PC3" get-process | select name | ConvertTo-Html -head $HTML_table_style -body " $test " | Out-File $env:USERPROFILE\documents\test.html Invoke-Item $env:USERPROFILE\documents\test.html This of course doesn't work and displays all elements in $test + . How in this one expression can I specify just one element in the array? August 18, 2015 at 9:49 am #28724 Don JonesKeymaster $test does refer to just one element in the array. But when used inside a double-quoted string, the [ character stops variable name evaluation. You need to put it into a subexpression. "$($test)" August 18, 2015 at 12:52 pm #28729 PoseyjParticipant A subexpression ahhhh, thanks much. Author Posts You must be logged in to reply to this topic.