I have a CSV file that contains lines like this:
"Title","Path" "News","/somepath/news.json/$variable1$variable2" "Boards","/somepath/$year/$variable3/boardfile.json"
I set all these variables in the script and then import data using Import-Csv cmdlet. As a result, I get object with Title and Path properties and that's what I need. But the problem is that the variables in the CSV file are not getting replaced with actual values during import.
I know there is a solution with Get-Content and ExpandVariable, but it produces an array of strings, and I would rather have an object (or maybe a hashtable?) with properties similar to what Import-Csv produces.
Is there a way to replace variables with values while still using Import-Csv and get a full-featured object as a result?