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 "& invoke-command -computername 'remoteserver' -scriptblock {...} ""/> when msbuild script contains above executes, command translated
powershell.exe -noninteractive -executionpolicy unrestricted -command "& invoke-command -computername 'remoteserver' -scriptblock {...} " as can see, """ , "'" translated whereas "&" not.
any clue much appreciated!
even though execution of msbuild script complain command , display "&" 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 "& invoke-command -computername 'remoteserver' -scriptblock {...} ""/> once changed above. works expected.
xml powershell msbuild escaping
Comments
Post a Comment