From 763eafd5dd191caa156c3f5496d1847445f0f300 Mon Sep 17 00:00:00 2001 From: Patrick <69651136+theparadox1083@users.noreply.github.com> Date: Thu, 21 Mar 2024 09:38:55 -0400 Subject: [PATCH] Update publish.md (PowerShell 7+ Access Token Example) Corrected PowerShell 7+ Parameter from Authorization to Authentication Converted Token text to SecureString Inline - token must be of type SecureString Added comment noting the Token parameter must be a SecureString --- docs/publish.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/publish.md b/docs/publish.md index 5239bbc6..6f08a8b9 100644 --- a/docs/publish.md +++ b/docs/publish.md @@ -3136,11 +3136,13 @@ with the token `tk_AgQdq7mVBoFD37zQVN29RhuMzNIz2`: === "PowerShell 7+" ``` powershell # 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 = @{ Method = "POST" URI = "https://ntfy.example.com/mysecrets" - Authorization = "Bearer" - Token = "tk_AgQdq7mVBoFD37zQVN29RhuMzNIz2" + Authentication = "Bearer" + Token = ConvertTo-SecureString "tk_AgQdq7mVBoFD37zQVN29RhuMzNIz2" -AsPlainText Body = "Look ma, with auth" } Invoke-RestMethod @Request