Hi i have this PowerShell script that I had been using for Quite a while, this takes what i have watched via emby and makes it unmonitored in sonarr
I'm trying to bring it up to date, and i have no contact with the original author, i have done my best with the limited knowledge i have and now I'm stuck and looking for help
here is the snippet from the PowerShell script for the changing from true to false, I'm sure I'm missing something really simple but i can't see it so asking here if any one knows,
Using PowerShell 7.3
If (($null -ne $Sonarr_EpisodeId) -and ($Sonarr_Monitored -eq $true))
{
$time = Get-Date -Format F
Log -logString $("[$time] - Sonarr Episode ID Found: "+$Sonarr_EpisodeId)
$data = @{
SeriesId = $Sonarr_SeriesId
id = $Sonarr_EpisodeId
monitored = 'false'
}
# Update Sonarr monitored status's
Invoke-RestMethod -Uri $getSonarrEpisodes$Sonarr_EpisodeId"&apikey="$Sonarr_Api_Key -Method Put -Body (ConvertTo-Json -InputObject $data) | Out-Null
Log -logString $("[$time] - Sonarr Episode ID: "+$Sonarr_EpisodeId.ToString("#####0").PadRight(6)+" Monitored Status Updated to False.")
}```
this is the line in the script
```ps
Invoke-RestMethod -Uri $getSonarrEpisodes$Sonarr_EpisodeId"&apikey="$Sonarr_Api_Key -Method Put -Body (ConvertTo-Json -InputObject $data) | Out-Null
that errors out on with a media not supported error
Edit: I have managed to rewrite the above line but with a new error
Invoke-RestMethod -Uri $getSonarrEpisodes$Sonarr_EpisodeId"&apikey="$Sonarr_Api_Key -Method Put -Body ConvertTo-Json (ConvertTo-Json $data) | Out-Null
BUt now gives me an error stating
Line | 672 | … Invoke-RestMethod -Uri $getSonarrEpisodes$Sonarr_EpisodeI … | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | A positional parameter cannot be found that accepts argument '{ "seriesId": 585, "id": 54357, "monitored": "false" }'.
It's just this one line that i am now having issues with, i just can't get it to write the change for the monitored tag
any help would be great?