[doc] add example for "update/upsert" for powershell
Question
Not a question, nor a defect nor a feature request, but more of a documentation update.
In https://www.nushell.sh/book/nushell_map.html, there is no example of upsert/update for powershell, while there could be one.
For example, in nushell, I can write:
open Cargo.toml | update package.version 1.0.0 | save --force Cargo.toml
While I have to write the following in powershell:
Get-Content Cargo.toml | ConvertFrom-Toml | ForEach-Object {$_.package.version = "1.0.0"; $_} | ConvertTo-Toml -Depth 20
So the equivalent of update would be ForEach-Object {$_.path.to.update = "new value"; $_}.
Yes, this makes nushell even nicer :D
Additional context and details
Note that the example given uses a powershell plugin to handle TOML, but the example would be the same with a json file and without plugins.
Thanks. Feel free to add this to our documentation. I'll move this issue over to our docs repo.
Should be closeable with #1497 committed - Thanks!