Invalid Runbook Authenticode signature status – NotSigned.

This bit me in the back today.

Some days ago I started signing all my Hybrid Runbook Worker Runbooks. I sync to my Automation Accounts via GitHub so after making changes I had the following code in a script that would sign my Runbooks:

The script works, and if I create new Runbooks with the signed Runbooks they execute fine. But if I sign a Runbook, sync to GitHub, then sync down to the Automation Account… they fail with the error in the post title. Not sure why but it sounds like the signature is not visible any more?

For now I don’t have time to troubleshoot further as I have to go and manually upload all my signed Runbooks. :( It’s not even a case of overwriting the existing contents with the signed version – I have to delete the Runbook and recreate it.