Fix PowerShell rendering, changelog

pull/348/head
Philipp Heckel 2022-06-27 12:21:11 -04:00
parent 50a830c360
commit f134bc6dcd
2 changed files with 30 additions and 24 deletions

View File

@ -883,9 +883,9 @@ is the only required one:
=== "PowerShell"
``` powershell
$uri = "https://ntfy.sh"
$body = @{
topic = "powershell"
$uri = "https://ntfy.sh"
$body = @{
topic = "mytopic"
title = "Low disk space alert"
message = "Disk space is low at 5.1 GB"
priority = 4
@ -900,8 +900,8 @@ $body = @{
url = "https://filesrv.lan/admin"
}
)
} | ConvertTo-Json
Invoke-RestMethod -Method 'Post' -Uri $uri -Body $body -ContentType "application/json" -UseBasicParsing
} | ConvertTo-Json
Invoke-RestMethod -Method 'Post' -Uri $uri -Body $body -ContentType "application/json" -UseBasicParsing
```
=== "Python"
@ -1233,7 +1233,7 @@ Alternatively, the same actions can be defined as **JSON array**, if the notific
}
)
} | ConvertTo-Json
Invoke-RestMethod -Method 'Post' -Uri $uri -Body $body -ContentType "application/json" -UseBasicParsing
Invoke-RestMethod -Method 'Post' -Uri $uri -Body $body -ContentType "application/json" -UseBasicParsing
```
=== "Python"
@ -1731,6 +1731,9 @@ And the same example using [JSON publishing](#publish-as-json):
=== "PowerShell"
``` powershell
# Powershell requires the 'Depth' argument to equal 3 here to expand 'Extras',
# otherwise it will read System.Collections.Hashtable in the returned JSON
$uri = "https://ntfy.sh"
$body = @{
topic = "wifey"
@ -1745,9 +1748,6 @@ And the same example using [JSON publishing](#publish-as-json):
}
}
)
# Powershell requires the 'Depth' argument to equal 3 here to expand 'Extras', otherwise it will read System.Collections.Hashtable in the returned json
} | ConvertTo-Json -Depth 3
Invoke-RestMethod -Method 'Post' -Uri $uri -Body $body -ContentType "application/json" -UseBasicParsing
```
@ -2002,6 +2002,9 @@ And the same example using [JSON publishing](#publish-as-json):
=== "PowerShell"
``` powershell
# Powershell requires the 'Depth' argument to equal 3 here to expand 'headers',
# otherwise it will read System.Collections.Hashtable in the returned JSON
$uri = "https://ntfy.sh"
$body = @{
topic = "myhome"
@ -2018,7 +2021,6 @@ And the same example using [JSON publishing](#publish-as-json):
body = '{"action": "close"}'
}
)
# Powershell requires the 'Depth' argument to equal 3 here to expand 'headers', otherwise it will read System.Collections.Hashtable in the returned json
} | ConvertTo-Json -Depth 3
Invoke-RestMethod -Method 'Post' -Uri $uri -Body $body -ContentType "application/json" -UseBasicParsing
```

View File

@ -32,6 +32,10 @@ Thank you to [@wunter8](https://github.com/wunter8) for proactively picking up s
* `ntfy user` commands don't work with `auth_file` but works with `auth-file` ([#344](https://github.com/binwiederhier/ntfy/issues/344), thanks to [@Histalek](https://github.com/Histalek) for reporting)
**Documentation:**
* Fix some PowerShell publish docs ([#345](https://github.com/binwiederhier/ntfy/pull/345), thanks to [@noahpeltier](https://github.com/noahpeltier))
-->
## ntfy server v1.27.2