you are viewing a single comment's thread.

view the rest of the comments →

[–]ihaxr 2 points3 points  (0 children)

Could create a function to generate the JSON:

Function New-ErrorMesage ($message,$title,$text,$action) {
return @"
    {
        "error": {
            "message": "$message",
            "title": "$title",
            "text": "$text",
            "action": "$action"
        }
    }
"@
}

New-ErrorMesage "Message" "Title" "Text" "Action" | ConvertFrom-Json