I have this cmd script:
REM Environment-Variables which can be used for Programs
REM ----------------------------------------------------------------
set SDENVDataPool=13
set SDENVDataPoolPath=C:\ProgramData\
The value 13 must be changed. I have tried this solution:
$line = Get-Content .\script.cmd | Select-String -Pattern "set SDENVDataPool" | Select-Object -ExpandProperty Line
$content = Get-Content .\script.cmd
$content | ForEach-Object {$_ -replace $line, "set SDENVDataPool=14"} | Set-Content .\script.cmd
The problem is that the line isn't read correctly. I get the whole file.
Can anyone help me?