I am trying to change a word in a file that is at the beginning of the line. In the rest of the document there are more lines with the same name, but I only want the one that starts at the beginning of the line to change.
The command I use is
(Get-Content -Path './prueba1.txt') -replace 'funcion','#funcion' | Set-Content -Path ./prueba1.txt
How can I specify that it be the beginning of the line?
Add a
^
in front of the word you have to search for: