diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 3151290fd9..f230320c12 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -9,6 +9,8 @@ Import-Module "$PSScriptRoot\..\Xml" -ErrorAction Stop -Force $DebianDistributions = @("ubuntu.16.04", "ubuntu.18.04", "debian.9", "debian.10", "debian.11") $RedhatDistributions = @("rhel.7","centos.8") $script:netCoreRuntime = 'net5.0' +$script:iconFileName = "Powershell_black_64.png" +$script:iconPath = Join-Path -path $PSScriptRoot -ChildPath "../../assets/$iconFileName" -Resolve function Start-PSPackage { [CmdletBinding(DefaultParameterSetName='Version',SupportsShouldProcess=$true)] @@ -2001,6 +2003,10 @@ function New-ILNugetPackage } New-NuSpec -PackageId $fileBaseName -PackageVersion $PackageVersion -Dependency $deps -FilePath (Join-Path $filePackageFolder.FullName "$fileBaseName.nuspec") + + # Copy icon file to package + Copy-Item -Path $iconPath -Destination "$($filePackageFolder.Fullname)/$iconFileName" -Verbose + New-NugetPackage -NuSpecPath $filePackageFolder.FullName -PackageDestinationPath $PackagePath } @@ -2134,7 +2140,7 @@ function New-NuSpec { throw "New-NuSpec can be only executed on Windows platform." } - $nuspecTemplate = $packagingStrings.NuspecTemplate -f $PackageId,$PackageVersion + $nuspecTemplate = $packagingStrings.NuspecTemplate -f $PackageId,$PackageVersion,$iconFileName $nuspecObj = [xml] $nuspecTemplate if ( ($null -ne $Dependency) -and $Dependency.Count -gt 0 ) { @@ -3689,6 +3695,9 @@ function New-GlobalToolNupkg $packageInfo | ForEach-Object { $ridFolder = New-Item -Path (Join-Path $_.RootFolder "tools/$script:netCoreRuntime/any") -ItemType Directory + # Add the icon file to the package + Copy-Item -Path $iconPath -Destination "$($_.RootFolder)/$iconFileName" -Verbose + $packageType = $_.Type switch ($packageType) @@ -3775,7 +3784,7 @@ function New-GlobalToolNupkg } $packageName = $_.PackageName - $nuSpec = $packagingStrings.GlobalToolNuSpec -f $packageName, $PackageVersion + $nuSpec = $packagingStrings.GlobalToolNuSpec -f $packageName, $PackageVersion, $iconFileName $nuSpec | Out-File -FilePath (Join-Path $_.RootFolder "$packageName.nuspec") -Encoding ascii $toolSettings | Out-File -FilePath (Join-Path $ridFolder "DotnetToolSettings.xml") -Encoding ascii diff --git a/tools/packaging/packaging.strings.psd1 b/tools/packaging/packaging.strings.psd1 index 7d8a38fd05..444bfa7f3a 100644 --- a/tools/packaging/packaging.strings.psd1 +++ b/tools/packaging/packaging.strings.psd1 @@ -130,14 +130,14 @@ open {0} {1} Microsoft Microsoft,PowerShell - true + false Runtime for hosting PowerShell https://github.com/PowerShell/PowerShell - https://github.com/PowerShell/PowerShell/blob/master/assets/Powershell_black_64.png?raw=true - https://github.com/PowerShell/PowerShell/blob/master/LICENSE.txt + {2} + MIT PowerShell en-US - © Microsoft Corporation. + © Microsoft Corporation. All rights reserved. @@ -167,13 +167,13 @@ open {0} Microsoft Microsoft,PowerShell https://github.com/PowerShell/PowerShell - https://github.com/PowerShell/PowerShell/blob/master/assets/Powershell_black_64.png?raw=true + {2} false PowerShell global tool MIT PowerShell en-US - © Microsoft Corporation. + © Microsoft Corporation. All rights reserved. diff --git a/tools/releaseBuild/azureDevOps/templates/nuget.yml b/tools/releaseBuild/azureDevOps/templates/nuget.yml index bfbf237e60..ed5bf65c7c 100644 --- a/tools/releaseBuild/azureDevOps/templates/nuget.yml +++ b/tools/releaseBuild/azureDevOps/templates/nuget.yml @@ -83,10 +83,8 @@ jobs: parameters: ReleaseTagVar: $(ReleaseTagVar) - - task: NuGetToolInstaller@0 - displayName: 'Install NuGet 4.9.3' - inputs: - versionSpec: 4.9.3 + - task: NuGetToolInstaller@1 + displayName: 'Install NuGet.exe' - powershell: | Import-Module $env:BUILD_SOURCESDIRECTORY\build.psm1