Hi,
Assuming the csv file has two columns with the headers "key" and "value", you write the key/value pairs to a hashtable like below
$file = "C:\temp\hashtable.csv"
$tags = @{}
Import-Csv -Path $file |ForEach-Object{
$tags.Add($_.key,$_.value)
}
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.