#证书标识
$Thumbprint="9BB8125CEF1685B93F4D024DFE1D472CAF185BC8"
#文件类型
$Include=@("*.dll","*.exe")
#选择文件夹
$openFileDialog1 = New-Object System.Windows.Forms.FolderBrowserDialog
$openFileDialog1.ShowDialog()
$folder=$openFileDialog1.SelectedPath
if(!$folder){exit}
$certificate=get-childitem cert:CurrentUser\My|?{$_.Thumbprint -eq $Thumbprint}
get-childitem $folder -Recurse -Force -Include $Include |Get-AuthenticodeSignature|
?{$_.Status -ne "Valid" -or $_.SignerCertificate -match $Thumbprint}|
%{Set-AuthenticodeSignature $_.path $certificate -TimeStampServer "http://timestamp.globalsign.com/scripts/timstamp.dll"}
powershell 代码数字签名
最新推荐文章于 2024-08-10 08:10:31 发布