Quick question, i'm trying to insert a variable into a string json body block like below, but when i perform a rest api call by passing the json body into the invoke-webrequest function, the variable is actually not getting inserted. In the alert software i'm using i just see the message as 'The following host $($scrapperHost) is not running!!'
#variable
$myHost = $Env:Computername
#variable prints the correct hostname
#string json body
$jsonBody = @'
{
"message": "The following host $($myHost) is not running!!"}
}