Trying to get a PowerShell deployment step to work to replace a variable string within a text file.
Working correctly with the syntax:
Get-Content $TextFile
$Content -replace “Variable”, “#{DBServer}”
But this only works when the string in the text file is “Variable”.
However, the compiled text file has the string “#{DBServer}”.
Getting stuck because Octopus seems to read the contents of the text file in but replacing the variable name at which point it does not find the #{DBServer} string.
How could I search for that string and replace with the value from the variable set?