Author Posts

March 12, 2017 at 6:10 pm

To do more production level PS administration within my Company's hosted environment, we have required AllSigned Execution Policy from a central box. A GPO was created and I went through the steps of creating my Code Signing Cert and imported it into the GPO for allowed signing of my scripts.

What seems cumbersome is that ever time I either run a new script or change my existing script, i have to create my new hash on the modified code...

Set-AuthenticodeSignature c:\foo.ps1 @(Get-ChildItem cert:\CurrentUser\My -codesign)[0]

Was wondering if there is an easier way to do this and what others do in their environments? My only thoughts on the matter are to modify my 'save' and/or 'run' execution commands to add this statement to modify my certs.

March 15, 2017 at 1:55 pm

The only way to make this easier is to use a script editor that can do it for you automatically. PrimalScript, for example, has an option for this, I think.