新增 line.ps1
param ([Parameter(Mandatory=$true)] [string]$Message,
[Parameter(Mandatory=$true)] [string]$StickerPackageId,
[Parameter(Mandatory=$true)] [string]$StickerId,
[Parameter(Mandatory=$true)] [string]$ImageThumbnail,
[Parameter(Mandatory=$true)]
[string]$ImageFullsize
)
$Headers = @{
“Authorization” = “Bearer 接收Token擺這邊”
}
$Body = @{
“message” = $Message
“stickerPackageId” = $StickerPackageId
“stickerId” = $StickerId
“imageThumbnail” = $ImageThumbnail
“imageFullsize” = $ImageFullsize
}
Invoke-WebRequest -Uri “https://notify-api.line.me/api/notify” -Method Post -Headers $Headers -Body $Body
執行 line.ps1 , 並帶入參數
powershell.exe -ExecutionPolicy Bypass -File “D:\BATCH\line\line.ps1” -Message “這是一則訊息” -StickerPackageId “1070” -StickerId “17843” -ImageThumbnail “https://linjakson.com/pic/vn2.jpg” -ImageFullsize “https://linjakson.com/pic/vn2.jpg”