Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$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
You can’t perform that action at this time.