You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ($ExistingSig.Status-ne'Valid'-or$ExistingSig.SignerCertificate.Issuer-notmatch'DigiCert'-or$ExistingSig.SignerCertificate.NotAfter-lt [datetime]::Now) {
Write-Host"Script file '$Script' signed with status: $($NewSig.Status)"
70
+
71
+
if (!(Test-Path-Path $OutputFolder)) {
72
+
$null=New-Item-Path $OutputFolder-Type Directory
73
+
}
74
+
Copy-Item-Path $Script-Destination $OutputFolder
75
+
} else {
76
+
Write-Host"Script file '$Script' does not need signing, current signature is valid."
77
+
}
78
+
}
79
+
} else {
80
+
Write-Warning"Skipping script signing, no currently valid DigiCert issued Authenticode signing certificate matching '$($CertificateSubjectName)' was found."
.WithCriteria(()=>(!string.IsNullOrWhiteSpace(BuildParameters.CertificateFilePath)&&FileExists(BuildParameters.CertificateFilePath))||BuildSystem.IsRunningOnTeamCity,"Skipping because unable to find certificate, and not running on TeamCity")
18
49
.WithCriteria(()=>BuildParameters.ShouldAuthenticodeSignPowerShellScripts,"Skipping since authenticode signing of PowerShell scripts has been disabled")
if ($ExistingSig.Status-ne'Valid'-or$ExistingSig.SignerCertificate.Issuer-notmatch'DigiCert'-or$ExistingSig.SignerCertificate.NotAfter-lt [datetime]::Now) {
33
+
$AllScriptsVerified=$false
34
+
Write-Output"Script file '$ScriptToVerify' contains an invalid signature, which must be corrected before build can succeed."
35
+
} else {
36
+
Write-Output"Script file '$ScriptToVerify' does not need signing, current signature is valid."
0 commit comments