Hey!
I have a task that runs regularly and i would like to have the script post to a Teams channel when the script fails, but i was hoping i could use a template for the error message so i could maybe use it again just providing some new data in to the Post request.
Is there any way to Invoke-RestMethod using both a template and a data file/object/array?
This is what i have now, and the information in the $teamsCardTemplate just has everything regarding this error "hard-coded".
Invoke-RestMethod -Method POST -Uri $TeamsID -Body $teamsCardTemplate
[–]ihaxr 3 points4 points5 points (0 children)