I'd like to replace a word inside a .cfg file with the name of the current user.
I know $env:username outputs the current user.
This is what I got:
(Get-Content -path path\example.cfg -Raw) -replace 'TEST','current_user' | Set-Content path\example.cfg
I'm trying to replace the word "TEST" with the current user.