Skip to content

Commit f971377

Browse files
Merge pull request #1062 from theparadox1083/patch-1
Update publish.md (PowerShell 7+ Access Token Example)
2 parents 4b2e383 + 763eafd commit f971377

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/publish.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -3136,11 +3136,13 @@ with the token `tk_AgQdq7mVBoFD37zQVN29RhuMzNIz2`:
31363136
=== "PowerShell 7+"
31373137
``` powershell
31383138
# With PowerShell 7 or greater, we can use the Authentication and Token parameters
3139+
# The Token parameter must be in the form of a System.Security.SecureString
3140+
31393141
$Request = @{
31403142
Method = "POST"
31413143
URI = "https://ntfy.example.com/mysecrets"
3142-
Authorization = "Bearer"
3143-
Token = "tk_AgQdq7mVBoFD37zQVN29RhuMzNIz2"
3144+
Authentication = "Bearer"
3145+
Token = ConvertTo-SecureString "tk_AgQdq7mVBoFD37zQVN29RhuMzNIz2" -AsPlainText
31443146
Body = "Look ma, with auth"
31453147
}
31463148
Invoke-RestMethod @Request

0 commit comments

Comments
 (0)