mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Added logic to create signing XML for NuGet packages (#6921)
This commit is contained in:
@@ -4,10 +4,11 @@ param(
|
||||
[Parameter(Mandatory)]
|
||||
[string] $Path,
|
||||
[string[]] $AuthenticodeDualFiles,
|
||||
[string[]] $AuthenticodeFiles
|
||||
[string[]] $AuthenticodeFiles,
|
||||
[string[]] $NuPkgFiles
|
||||
)
|
||||
|
||||
if ((!$AuthenticodeDualFiles -or $AuthenticodeDualFiles.Count -eq 0) -and (!$AuthenticodeFiles -or $AuthenticodeFiles.Count -eq 0))
|
||||
if ((!$AuthenticodeDualFiles -or $AuthenticodeDualFiles.Count -eq 0) -and (!$AuthenticodeFiles -or $AuthenticodeFiles.Count -eq 0) -and (!$NuPkgFiles -or $NuPkgFiles.Count -eq 0))
|
||||
{
|
||||
throw "At least one file must be specified"
|
||||
}
|
||||
@@ -69,6 +70,11 @@ foreach($file in $AuthenticodeFiles)
|
||||
New-FileElement -File $file -SignType 'Authenticode' -XmlDoc $signingXml -Job $job
|
||||
}
|
||||
|
||||
foreach($file in $NuPkgFiles)
|
||||
{
|
||||
New-FileElement -File $file -SignType 'NuGet' -XmlDoc $signingXml -Job $job
|
||||
}
|
||||
|
||||
$signingXml.Save($path)
|
||||
$updateScriptPath = Join-Path -Path $PSScriptRoot -ChildPath 'updateSigning.ps1'
|
||||
& $updateScriptPath -SigningXmlPath $path
|
||||
|
||||
Reference in New Issue
Block a user