Fix issues reported by code signing verification tool (#16291)

This commit is contained in:
Aditya Patwardhan 2021-10-22 16:45:51 -07:00 committed by GitHub
parent 6302f4815a
commit 15ac9485de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View file

@ -441,6 +441,10 @@ Fix steps:
# Add --self-contained due to "warning NETSDK1179: One of '--self-contained' or '--no-self-contained' options are required when '--runtime' is used."
if ($Options.Runtime -like 'fxdependent*') {
$Arguments += "--no-self-contained"
# The UseAppHost = false property avoids creating ".exe" for the fxdependent packages.
# The ".exe" is not a cross-platform executable, but specific to the platform that it was built on.
# We do not need to ship that.
$Arguments += "/property:UseAppHost=false"
}
else {
$Arguments += "--self-contained"

View file

@ -6,6 +6,7 @@
<AssemblyName>Microsoft.PowerShell.GlobalTool.Shim</AssemblyName>
<OutputType>EXE</OutputType>
<RootNamespace>Microsoft.PowerShell.GlobalTool.Shim</RootNamespace>
<UseAppHost>False</UseAppHost>
</PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" Condition="'$(SDKToUse)' == 'Microsoft.NET.Sdk' " />

View file

@ -177,7 +177,7 @@ jobs:
Update-PSSignedBuildFolder -BuildPath $BuildPath -SignedFilesPath $SignedFilesPath
$dlls = Get-ChildItem $BuildPath\*.dll, $BuildPath\*.exe -Recurse
$signatures = $dlls | Get-AuthenticodeSignature
$missingSignatures = $signatures | Where-Object { $_.status -eq 'notsigned'}| select-object -ExpandProperty Path
$missingSignatures = $signatures | Where-Object { $_.status -eq 'notsigned' -or $_.SignerCertificate.Issuer -notmatch '^CN=Microsoft.*'}| select-object -ExpandProperty Path
Write-Verbose -verbose "to be signed:`r`n $($missingSignatures | Out-String)"