mirror of
https://github.com/binwiederhier/ntfy.git
synced 2024-11-26 21:25:18 +01:00
Merge pull request #1062 from theparadox1083/patch-1
Update publish.md (PowerShell 7+ Access Token Example)
This commit is contained in:
commit
f971377cbb
1 changed files with 4 additions and 2 deletions
|
@ -3136,11 +3136,13 @@ with the token `tk_AgQdq7mVBoFD37zQVN29RhuMzNIz2`:
|
||||||
=== "PowerShell 7+"
|
=== "PowerShell 7+"
|
||||||
``` powershell
|
``` powershell
|
||||||
# With PowerShell 7 or greater, we can use the Authentication and Token parameters
|
# With PowerShell 7 or greater, we can use the Authentication and Token parameters
|
||||||
|
# The Token parameter must be in the form of a System.Security.SecureString
|
||||||
|
|
||||||
$Request = @{
|
$Request = @{
|
||||||
Method = "POST"
|
Method = "POST"
|
||||||
URI = "https://ntfy.example.com/mysecrets"
|
URI = "https://ntfy.example.com/mysecrets"
|
||||||
Authorization = "Bearer"
|
Authentication = "Bearer"
|
||||||
Token = "tk_AgQdq7mVBoFD37zQVN29RhuMzNIz2"
|
Token = ConvertTo-SecureString "tk_AgQdq7mVBoFD37zQVN29RhuMzNIz2" -AsPlainText
|
||||||
Body = "Look ma, with auth"
|
Body = "Look ma, with auth"
|
||||||
}
|
}
|
||||||
Invoke-RestMethod @Request
|
Invoke-RestMethod @Request
|
||||||
|
|
Loading…
Reference in a new issue