Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert a hashtable's keys to a list of strings

I wanted to do [string]::Join(", ", $HashTable.Keys); but that returns System.Collections.Hashtable+KeyCollection... instead of the enumerated values.

Do I need to make a foreach loop for this?

like image 242
rui Avatar asked Dec 27 '12 12:12

rui


1 Answers

You can simply do:

$HashTable.Keys -join ','
like image 190
Shay Levy Avatar answered Oct 06 '22 09:10

Shay Levy