In Powershell script, I have Hashtable contains personal information. The hashtable looks like
{first = "James", last = "Brown", phone = "12345"...}
Using this hashtable, I would like to replace strings in template text file. For each string matches @key@ format, I want to replace this string to value that correspond to key in hashtable. Here is a sample input and output:
input.txt
My first name is @first@ and last name is @last@.
Call me at @phone@
output.txt
My first name is James and last name is Brown.
Call me at 12345
Could you advise me how to return "key" string between "@"s so I can find their value for the string replacement function? Any other ideas for this problem is welcomed.