Skip to content

Instantly share code, notes, and snippets.

@Philmist
Created November 27, 2022 12:40
Show Gist options
  • Save Philmist/686f43f83bd6478d078b8985df9849dd to your computer and use it in GitHub Desktop.
Save Philmist/686f43f83bd6478d078b8985df9849dd to your computer and use it in GitHub Desktop.
どう見てもおかしいConvertFrom-Jsonと格闘した結果
$result = @{"method"="getChannels";"id"=19021;"jsonrpc"="2.0";"params"=@{}} | ConvertTo-Json | Invoke-WebRequest -Method Post -Headers @{"Content-type"="application/json";"X-Requested-With"="XMLHttpRequest"} http://192.168.0.100:7144/api/1 | %{ [Text.Encoding]::UTF8.GetString([Text.Encoding]::UTF8.GetBytes($_.Content)) } | ConvertFrom-Json
$result.result | %{ $_.info }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment