Someone has already done the hard work to write an MSBuild task that allows you to call PowerShell scripts a bit like this :
<UsingTask
AssemblyFile="PowershellMSBuildTask.dll"
TaskName="PowerShell" />
<PropertyGroup>
<ReplaceScript>
<![CDATA[get-content "..." | % { $_.Replace("something", "something else") } | set-content "..."]]>
</ReplaceScript>
</PropertyGroup>
<Target Name="AfterGet">
<Powershell Script="$(ReplaceScript)/>"
</Target>