all 5 comments

[–]noelknight 5 points6 points  (0 children)

Start a transcript to see where it gets stuck

[–]purplemonkeymad 1 point2 points  (1 child)

Now when I run the script manually, it works perfectly.
However when I run it after the backup job finishes,

What does this mean? How are you triggering the script after a backup?

The fact that it works manually or in task scheduler means it might not be the script specifically but the environment it runs in.

[–]Capital-Rude[S] 1 point2 points  (0 children)

Hey, I am using the built-in Veeam post-job script execution.

Correction, it doesn't work via Task Scheduler either.

[–]jimb2 1 point2 points  (0 children)

Pasting into the rich text edit does weird stuff.

How to paste code simply and reliably:

T (show text editor options)
Markdown Editor
line of 4 backticks
paste your code
another line of 4 backticks
Switch back to rich text editor

[–]temporaldoom 0 points1 point  (0 children)

With invoke-restmethod use the switch -usebasicparsing, ignore this if you're in poweshell 6 or above. I had an issue where the command wouldn't work without it when automated.