mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-09 21:07:40 +02:00
Add datatype to param()
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user