powershell - & in XML does not get replaced by & -



powershell - & in XML does not get replaced by & -

i'm tweaking msbuild file continuous integration. more specific, seek phone call powershell task on remote server within msbuild file, underthe guidance microsoft official help. great except "&" in msbuild file not replaced "&". example,

<exec command="powershell.exe -noninteractive -executionpolicy unrestricted -command &quot;&amp; invoke-command -computername &apos;remoteserver&apos; -scriptblock {...} &quot;"/>

when msbuild script contains above executes, command translated

powershell.exe -noninteractive -executionpolicy unrestricted -command "&amp; invoke-command -computername 'remoteserver' -scriptblock {...} "

as can see, "&quot;" , "&apos;" translated whereas "&amp;" not.

any clue much appreciated!

even though execution of msbuild script complain command , display "&amp;" in message. not root of issue.

the root msbuild script not single powershell command spread multiple lines.

<exec command="powershell.exe -noninteractive -executionpolicy unrestricted -command &quot;&amp; invoke-command -computername &apos;remoteserver&apos; -scriptblock {...} &quot;"/>

once changed above. works expected.

xml powershell msbuild escaping

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -