瀏覽代碼

Update publish.md with powershell snippet for uploading files

YMan84 2 年之前
父節點
當前提交
7dfcda9306
共有 1 個文件被更改,包括 12 次插入1 次删除
  1. 12 1
      docs/publish.md

+ 12 - 1
docs/publish.md

@@ -2439,7 +2439,18 @@ Here's an example showing how to upload an image:
     req.Header.Set("Filename", "flower.jpg")
     req.Header.Set("Filename", "flower.jpg")
     http.DefaultClient.Do(req)
     http.DefaultClient.Do(req)
     ```
     ```
-
+    
+=== "PowerShell"
+    ``` powershell
+$Request = @{
+    Method = "POST" 
+    Uri = "ntfy.sh/flowers"
+    InFile = "flower.jpg"
+    Headers = @{"Filename" = "flower.jpg"}
+}
+    Invoke-RestMethod @Request
+    ```
+    
 === "Python"
 === "Python"
     ``` python
     ``` python
     requests.put("https://ntfy.sh/flowers",
     requests.put("https://ntfy.sh/flowers",