Advertisement
Guest User

Untitled

a guest
May 19th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. $JSON = @"
  2. [{
  3. "Subtitle": {
  4. "Search": {
  5. "Burn": false,
  6. "Default": false,
  7. "Enable": false,
  8. "Forced": false
  9. },
  10. "SubtitleList": [{
  11. "Burn": false,
  12. "Default": false,
  13. "Forced": false,
  14. "ID": 1,
  15. "Offset": 0,
  16. "Track": 0
  17. }]
  18. }
  19. }]
  20. "@
  21.  
  22. $JSON = ($JSON | ConvertFrom-Json);
  23.  
  24. $JSON | % {
  25. If(($_.Subtitle.SubtitleList[0].ID -eq 1) -and ($_.Subtitle.SubtitleList[0].Track -eq 0))
  26. {
  27. If (!($_.Subtitle.SubtitleList[0].Default = "true"))
  28. {
  29. $_.Subtitle.SubtitleList[0].Default = "true";
  30. }
  31. }
  32. };
  33. $x = $JSON | ConvertTo-Json -depth 32;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement