Im running the following command in my pre build event
(get-content "$(SolutionDir)woop.txt") -replace 'HELLO','GOODBYE' | set-content "$(SolutionDir)woop.txt"
however im getting the following error:
The command "(get-content "C:\Users\jonny\Desktop\data\a\woop.txt") -replace 'HELLO','GOODBYE' | set-content "C:\Users\jonny\Desktop\data\a\woop.txt"" exited with code 255.
Any one got any ideas?
build events scripts are dos script based, not PowerShell…
I suggest you to wrap your script in a ps1 file, then executing powershell.Exe with the proper arguments.
EDIT
This article shows how to do it.