in the 7th (and, it seems, in the 6th) powersale works like this:
$token = "ХХХХХХХХХХХ"
$chat_id = "ХХХХХХХХХ"
$uri = "https://api.telegram.org/bot$Token/sendDocument"
$fileObject= get-item C:\test\1.pdf
$Form = @{
chat_id = $Chat_ID
document = $fileObject
}#form
$invokeRestMethodSplat = @{
Uri = $Uri
ErrorAction = 'Stop'
Form = $Form
Method = 'Post'
}
Invoke-RestMethod @invokeRestMethodSplat
в 5ом нет параметра форм в Invoke-RestMethod и там нужны пляски с бубном.