TomWright / dasel

Select, put and delete data from JSON, TOML, YAML, XML and CSV files with a single tool. Supports conversion between formats and can be used as a Go package.
https://daseldocs.tomwright.me
MIT License
4.98k stars 115 forks source link

Windows installation instructions do not work #404

Open sjfke opened 2 months ago

sjfke commented 2 months ago

Current Windows installation instructions are incorrect, curl unsupported options

$releases = curl -sSLf https://api.github.com/repos/tomwright/dasel/releases/latest
Invoke-WebRequest -Uri (($releases | ConvertFrom-Json).assets `
                    | Where-Object { $_.name -eq "dasel_windows_amd64.exe" } `
                    | Select-Object -ExpandProperty browser_download_url) `
                    -OutFile dasel.exe

The curl should be replaced with Invoke-RestMethod and the Invoke-WebRequest changed

$releases = Invoke-RestMethod -Uri https://api.github.com/repos/tomwright/dasel/releases/latest
Invoke-WebRequest -Uri ( $releases.assets `
                    | Where-Object { $_.name -eq "dasel_windows_amd64.exe" } `
                    | Select-Object -ExpandProperty browser_download_url ) `
                    -OutFile dasel.exe

The Invoke-RestMethod converts the response into a PowerShell object, so conversion from JSON is unnecessary

TomWright commented 2 months ago

Could you raise a PR for this please? I don't use Windows so am unable to test