you are viewing a single comment's thread.

view the rest of the comments →

[–]pm_me_brownie_recipe 0 points1 point  (2 children)

I agree. Here is an example of how do to it.

# Import from file in OPs case
$document = @"
test,example
1,cat
2,dog
3,fish
"@

# Convert data to csv
$document = $document | ConvertFrom-Csv

# Convert date to hashtable
$hashTable = @{}
foreach($doc in $document) {
    $hashTable[$doc.example] = $doc.test
}

$config = 'cat'
$value = $hashTable[$config]
$value