Not sure the root reason for it, but if you just want to have a communication with your bot using PowerShell Script, you can use direct line 3.0 API to do so as a workaround.
Try command below:
$clientID = ""
$clientSecret = ""
$directLinekey = ""
$StartConversationUrl = "https://webchat.botframework.com/v3/directline/conversations"
# Get Token
$params = @{
ContentType = 'application/x-www-form-urlencoded'
Headers = @{"Authorization"="Bearer $directLinekey" }
Method = 'POST'
URI = $StartConversationUrl
}
$result = Invoke-RestMethod @params
$conversationID = $result.conversationId
$token = $result.token
# Send message to Azure Bot
$postMessageURL = "https://webchat.botframework.com/v3/directline/conversations/$conversationID/activities"
$botBody = @'
{
"locale": "en-EN",
"type":"message",
"from": {
"id": "user1"
},
"text":"hello"
}
'@
$sendMessageParams = @{
ContentType = 'application/json'
Headers = @{"Authorization"="Bearer $token"}
Method = 'POST'
Body= $botBody
URI = $postMessageURL
}
$messageResult = Invoke-RestMethod @sendMessageParams
$id= $messageResult.id
$getMessageURL = "https://webchat.botframework.com/v3/directline/conversations/$conversationID/activities"
$getMessageParams = @{
ContentType = 'application/json'
Headers = @{"Authorization"="Bearer $token"}
Method = 'get'
URI = $getMessageURL
}
$allActs = Invoke-RestMethod @getMessageParams
foreach($act in $allActs.activities){
$act.from
$act.text
echo('-------')
}
Result on my side:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…