DaveWentzel.com            All Things Data

signed scripts

 

The default execution policy is Restricted Execution.  This can be changed with:
 
get-execution policy
 
You can change the execution policy in the registry as well.  HKLM\Software\Microsoft\PowerShell.  Valid values
 
RemoteSigned
any script run locally, remote execution via signed scripts only
Unrestricted
 
Restricted
interactive shell only (default)
Allsigned
every script must be signed by a trusted publisher
 
How to Sign a Script
 
get-authenticodesignature
set-authenticodesignature
 
If you want to distribute signed scripts you will need a commercial code signing certificate.  Or use makecert.exe.  Its a two-step process.

create a certificate for PowerShell

makecert -n

create a code-signing certificate

makecert -pe - n

 

 
 

Add new comment