I’ve got a hashtable:
$hash = @{ First = 'Al'; Last = 'Bundy' }
I know that I can do this:
Write-Host "Computer name is ${env:COMPUTERNAME}"
So I was hoping to do this:
Write-Host "Hello, ${hash.First} ${hash.Last}."
…but I get this:
Hello, .
How do I reference hash table members in string interpolation?
1 Answer