Add datatype to param()

This commit is contained in:
Markus Fleschutz
2021-07-15 15:51:22 +02:00
parent 35255539df
commit b97098fc42
109 changed files with 256 additions and 216 deletions

View File

@ -11,13 +11,11 @@
Author: Markus Fleschutz / License: CC0
#>
param($Message = "")
if ($Message -eq "" ) {
$URL = read-host "Enter alert message"
}
param([string]$Message = "")
try {
if ($Message -eq "" ) { $URL = read-host "Enter alert message" }
echo "ALERT: $Message"
curl --header "Access-Token: o.PZl5XCp6SBl4F5PpaNXGDfFpUJZKAlEb" --header "Content-Type: application/json" --data-binary '{"type": "note", "title": "ALERT", "body": "$Message"}' --request POST https://api.pushbullet.com/v2/pushes