Minor changes in Windows scripts

Minor changes in Windows scripts
This commit is contained in:
Alexander I. Chebykin
2022-06-27 09:35:30 +03:00
parent 024fe94ce9
commit 577ad19b9f
2 changed files with 16 additions and 18 deletions

View File

@@ -1,10 +1,10 @@
Function Send-Telegram {
Param([Parameter(Mandatory=$true)][String]$Message)
Param([Parameter(Mandatory=$true)][String]$Message)
$Telegramtoken = "Your_Telegram_Token"
$Telegramchatid = "Your_Telegram_Chat_ID"
$Telegramtoken = "Your_Telegram_Token"
$Telegramchatid = "Your_Telegram_Chat_ID"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$Message = $args[0]
$Response = Invoke-RestMethod -Uri "https://api.telegram.org/bot$($Telegramtoken)/sendMessage?chat_id=$($Telegramchatid)&text=$($Message)"
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$Response = Invoke-RestMethod -Uri "https://api.telegram.org/bot$($Telegramtoken)/sendMessage?chat_id=$($Telegramchatid)&text=$($Message)"