This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$MyCert = new-SelfSignedCertificate -CertStoreLocation Cert:\LocalMachine\my ` | |
-DnsName api.vm360degee.com ` | |
-friendlyname api.vm360degree.com ` | |
-NotAfter ( [DateTime]::Now.AddYears(5)) ` | |
-KeyAlgorithm RSA ` | |
-KeyLength 2048 ` | |
-KeySpec Signature ` | |
-Provider "Microsoft Enhanced RSA and AES Cryptographic Provider" ` | |
-KeyExportPolicy Exportable ` | |
-KeyUsage DigitalSignature ` | |
-Type CodeSigningCert | |
$MyPath = 'Cert:\LocalMachine\my\' + $MyCert.Thumbprint | |
Move-Item -Path $MyPath -Destination Cert:\LocalMachine\Root | |
$cert= Get-ChildItem cert:\localmachine\root -CodeSigningCert |?{$_.friendlyname -eq "api.vm360degree.com"} | |
Set-AuthenticodeSignature C:\work\Azure\cert\hello.ps1 ` | |
-Certificate $cert ` | |
-TimestampServer http://timestamp.comodoca.com/authenticode | |
Get-AuthenticodeSignature -FilePath C:\work\Azure\cert\hello.ps1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment