You can use a "here-string" to avoid escaping:
```
$dllNameClass = @"
...
    private const string libgit2 = "git2_$shortsha";
...
"@