PowerTip: Convert Character Array to String
Summary: Easily convert a character array to a string in Windows PowerShell.
How can I use Windows PowerShell to convert data that is returning as an array of characters
instead of as a single string?
Use the unary operator, and pass the array. In the following example, the first command returns an
array of characters, and the next the unary operator converts the character array to a single string:
PS C:\> $a = (get-module -l).Path | split-path -Parent
PS C:\> $a
PS C:\> $b = (,$a)
PS C:\> $b