Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Sign Powershell Script ====== * [[https://community.spiceworks.com/how_to/153255-windows-10-signing-a-powershell-script-with-a-self-signed-certificate ]] <code> New-Self​Signed​Certificate PS C:\tmp\Azure> New-SelfSignedCertificate -CertStoreLocation cert:\currentuser\my -Subject "CN=Local Code Signing" -KeyAlgorithm RSA -KeyLength 2048 -Provider "Microsoft Enhanced RSA and AES Cryptographic Provider" -KeyExportPolicy Exportable -KeyUsage DigitalSignature ` -Type CodeSigningCert PSParentPath: Microsoft.PowerShell.Security\Certificate::CurrentUser\my Thumbprint Subject ---------- ------- FBEA9166C4E1429775EB6BDEE47E54E49083811C CN=Local Code Signing $cert = @(Get-ChildItem cert:\CurrentUser\My -CodeSigning)[0] Set-AuthenticodeSignature .\your-script.ps1 $cert </code> qnd/sign_powershell_script.txt Last modified: 2021/03/10 20:08by mgupton