/
diev
/
mRemoteNG
Обзор
Документация
Войти
/
diev
/
mRemoteNG
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
Tools/signfiles.ps1
31 строка
1 KB
David Sparer
added ability to exclude files for signing. cleaned up script
17 мар 2017, 18:17
17 мар 2017, 18:17
0d177d1
Код
Авторство
О чём код?
param( [string] [Parameter(Mandatory=$true)] # Folder path that contains the files you would like to sign. Recursive. $PathToSignableFiles, [string] # The code signing certificate to use when signing the files. $CertificatePath = "C:\mRemoteNG_code_signing_cert.pfx", [SecureString] # Password to unlock the code signing certificate. $CertificatePassword = (Get-Credential -Message "Enter password for the mRemoteNG code signing certificate" -UserName "USERNAME NOT NEEDED").Password, [string[]] # File names to exclude from signing $Exclude ) $timeserver = "http://timestamp.verisign.com/scripts/timstamp.dll" $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($CertificatePath, $CertificatePassword) Write-Output "Getting files from path: $PathToSignableFiles" $signableFiles = Get-ChildItem -Path $PathToSignableFiles -Recurse | ?{$_.Extension -match "dll|exe|msi"} | ?{$Exclude -notcontains $_.Name} Write-Output "Signable files count: $($signableFiles.Count)" foreach ($file in $signableFiles) { Set-AuthenticodeSignature -Certificate $cert -TimestampServer $timeserver -IncludeChain all -FilePath $file.FullName }