Replace text in a file

Common questions about using Actual Installer.
Post Reply
Posts: 25
Joined: Mon Nov 30, 2015 5:50 pm

Replace text in a file

Post by ggrewe »

Is there a process available to replace text in a file with the value of a variable?

For example, in the app.config, can we change the value of a key with <CustomUserInfo>?

I see that we can run a custom action, but can the custom action run a PowerShell function?

Code: Select all

(Get-Content test.txt) | ForEach-Object { $_ -replace "foo", <CustomUserInfo> } | Set-Content test.txt
Post Reply