-
Notifications
You must be signed in to change notification settings - Fork 373
Closed
Labels
Description
The current implementation of the PowerShell generator requires a lot of escapes ``" for each quote and linefeed
this makes the generated core hard to read and change and verify.
Describe the solution you'd like
get rid of the escapes by using a PowerShell here-strings @" .... "@
I would preferer the double-quoted version as that will support variable replacement.
Proposed use of here-string:
$body = @"
{
"type":"message",
"attachments":[
{
"contentType":"application/vnd.microsoft.card.adaptive",
"contentUrl":null,
"content":
// insert card here
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": "Publish Adaptive Card schema",
"weight": "bolder",
"size": "medium"
}
]
//up to here
}
]
}
"@Current use of many escapes:
$body = "{
`n `"type`":`"message`",
`n `"attachments`":[
`n {
`n `"contentType`":`"application/vnd.microsoft.card.adaptive`",
`n `"contentUrl`":null,
`n `"content`":
`n// insert card here
`n{
`n `"$schema`": `"http://adaptivecards.io/schemas/adaptive-card.json`",
`n `"type`": `"AdaptiveCard`",
`n `"version`": `"1.0`",
`n `"body`": [
`n {
`n `"type`": `"TextBlock`",
`n `"text`": `"Publish Adaptive Card schema`",
`n `"weight`": `"bolder`",
`n `"size`": `"medium`"
`n }
`n]
`n
`n//up to here
`n
`n }
`n ]
`n}"Reactions are currently unavailable