Kaynağa Gözat

Merge pull request #1062 from theparadox1083/patch-1

Update publish.md (PowerShell 7+ Access Token Example)
Philipp C. Heckel 1 yıl önce
ebeveyn
işleme
f971377cbb
1 değiştirilmiş dosya ile 4 ekleme ve 2 silme
  1. 4 2
      docs/publish.md

+ 4 - 2
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