株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

jqを使うと文字化けする

PS C:\Users\yuta>  $subjectlist = (Invoke-WebRequest -Uri "https://graph.microsoft.com/v1.0/users/$SmtpAddress/calendar/events?`$filter=Subject eq '$item'" -Headers @{Authorization = "Bearer " + $Token } -ContentType " application/json" -Method Get).content | jq '.value[].subject '
PS C:\Users\yuta> $subjectlist
"螂・譚代&繧・
"螂・譚代&繧・

ConvertFrom-Json経由でプロパティを取り出すときれいに取得できる

PS C:\Users\yuta>  $subjectlist = ((Invoke-WebRequest -Uri "https://graph.microsoft.com/v1.0/users/$SmtpAddress/calendar/events?`$filter=Subject eq '$item'" -Headers @{Authorization = "Bearer " + $Token } -ContentType " application/json" -Method Get).content | ConvertFrom-Json).value.subject
PS C:\Users\yuta> $subjectlist
奥村さん
奥村さん
PS C:\Users\yuta>

<スポンサーリンク>

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)