Fix PowerShell rendering, changelog
This commit is contained in:
parent
50a830c360
commit
f134bc6dcd
2 changed files with 30 additions and 24 deletions
|
@ -883,9 +883,9 @@ is the only required one:
|
||||||
|
|
||||||
=== "PowerShell"
|
=== "PowerShell"
|
||||||
``` powershell
|
``` powershell
|
||||||
$uri = "https://ntfy.sh"
|
$uri = "https://ntfy.sh"
|
||||||
$body = @{
|
$body = @{
|
||||||
topic = "powershell"
|
topic = "mytopic"
|
||||||
title = "Low disk space alert"
|
title = "Low disk space alert"
|
||||||
message = "Disk space is low at 5.1 GB"
|
message = "Disk space is low at 5.1 GB"
|
||||||
priority = 4
|
priority = 4
|
||||||
|
@ -900,8 +900,8 @@ $body = @{
|
||||||
url = "https://filesrv.lan/admin"
|
url = "https://filesrv.lan/admin"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
} | ConvertTo-Json
|
} | 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"
|
=== "Python"
|
||||||
|
@ -1233,7 +1233,7 @@ Alternatively, the same actions can be defined as **JSON array**, if the notific
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
} | ConvertTo-Json
|
} | 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"
|
=== "Python"
|
||||||
|
@ -1731,6 +1731,9 @@ And the same example using [JSON publishing](#publish-as-json):
|
||||||
|
|
||||||
=== "PowerShell"
|
=== "PowerShell"
|
||||||
``` 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"
|
$uri = "https://ntfy.sh"
|
||||||
$body = @{
|
$body = @{
|
||||||
topic = "wifey"
|
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
|
} | ConvertTo-Json -Depth 3
|
||||||
Invoke-RestMethod -Method 'Post' -Uri $uri -Body $body -ContentType "application/json" -UseBasicParsing
|
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
|
``` 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"
|
$uri = "https://ntfy.sh"
|
||||||
$body = @{
|
$body = @{
|
||||||
topic = "myhome"
|
topic = "myhome"
|
||||||
|
@ -2018,7 +2021,6 @@ And the same example using [JSON publishing](#publish-as-json):
|
||||||
body = '{"action": "close"}'
|
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
|
} | ConvertTo-Json -Depth 3
|
||||||
Invoke-RestMethod -Method 'Post' -Uri $uri -Body $body -ContentType "application/json" -UseBasicParsing
|
Invoke-RestMethod -Method 'Post' -Uri $uri -Body $body -ContentType "application/json" -UseBasicParsing
|
||||||
```
|
```
|
||||||
|
|
|
@ -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)
|
* `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
|
## ntfy server v1.27.2
|
||||||
|
|
Loading…
Reference in a new issue