"Here string" shows error in editor when text is XML.

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 6 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
petera
Posts: 11
Last visit: Thu Jun 15, 2023 8:52 am

"Here string" shows error in editor when text is XML.

Post by petera »

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: PowerShell Studio V 5.4.145.0
32 or 64 bit version of product: 64
Operating system:
32 or 64 bit OS: 64

*** Please add details and screenshots as needed below. ***
Editor shows a syntax error that says "The string is missing the terminator "@'" when the "@" is there. But it runs OK in PowerShell studio when I test.

Have included screen shot of same code in PowerGui editor, that does not show a syntax error.

Maybe it does not like the XML data? If data is just plain text it does not show an error.
This is the code:

$publishXmlData = @"
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<IncludeCompositeObjects>True</IncludeCompositeObjects>
<TargetDatabaseName></TargetDatabaseName>
<DeployScriptFileName>publishXml</DeployScriptFileName>
<TargetConnectionString>Data Source=;Integrated Security=True;Pooling=False</TargetConnectionString>
<ProfileVersionNumber>1</ProfileVersionNumber>
<ScriptDatabaseOptions>True</ScriptDatabaseOptions>
<BlockOnPossibleDataLoss>False</BlockOnPossibleDataLoss>
<ScriptRefreshModule>False</ScriptRefreshModule>
</PropertyGroup>
</Project>`
"@

$publishXmlData | Out-Host
Attachments
powergui example.png
powergui example.png (66.15 KiB) Viewed 2088 times
Here String Error.png
Here String Error.png (30.81 KiB) Viewed 2088 times
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: "Here string" shows error in editor when text is XML.

Post by Alexander Riedel »

This functionality is using Microsoft's own PowerShell parser.
It is possible that it misinterprets the position of the closing "@, which has to be on the beginning of a line, due to the backtic in the preceding line.
I would eliminate that and see what that does.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
petera
Posts: 11
Last visit: Thu Jun 15, 2023 8:52 am

Re: "Here string" shows error in editor when text is XML.

Post by petera »

That fixed it. Thanks.
This topic is 6 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.