I have to replace my PHP variable with powershell. The variable is $env = "TEST" but with powershell I want to replace it to $env = "TEST" because of using Azure Releases. Currently I am having a sript like this:
(Get-Content -Path 'C:\MyProject\MyBuildOutputs\connect.php') |
Foreach-Object { $_ -replace '$env = "TEST"', '$env = "PROD"' } |
Set-Content -Path 'C:\MyProject\MyBuildOutputs\connect.php' -Force
But unfortunately it doesn't work and I don't know why.
How do I do that?