diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index e3b00019d9a..dad70f0589f 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -8,6 +8,8 @@ $packagingStrings = Import-PowerShellDataFile "$PSScriptRoot\packaging.strings.p Import-Module "$PSScriptRoot\..\Xml" -ErrorAction Stop -Force $DebianDistributions = @("ubuntu.16.04", "ubuntu.18.04", "ubuntu.20.04", "debian.9", "debian.10", "debian.11") $RedhatDistributions = @("rhel.7","centos.8") +$script:iconFileName = "Powershell_black_64.png" +$script:iconPath = Join-Path -path $PSScriptRoot -ChildPath "../../assets/$iconFileName" -Resolve function Start-PSPackage { [CmdletBinding(DefaultParameterSetName='Version',SupportsShouldProcess=$true)] @@ -2170,7 +2172,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 ) { @@ -3750,6 +3752,9 @@ function New-GlobalToolNupkg $packageInfo | ForEach-Object { $ridFolder = New-Item -Path (Join-Path $_.RootFolder "tools/netcoreapp3.1/any") -ItemType Directory + # Add the icon file to the package + Copy-Item -Path $iconPath -Destination "$($_.RootFolder)/$iconFileName" -Verbose + $packageType = $_.Type switch ($packageType) @@ -3836,7 +3841,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 3327fc28663..d2ffee81ab4 100644 --- a/tools/packaging/packaging.strings.psd1 +++ b/tools/packaging/packaging.strings.psd1 @@ -130,11 +130,11 @@ 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. All rights reserved. @@ -169,7 +169,7 @@ 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