diff --git a/assets/pwsh.manifest b/assets/pwsh.manifest new file mode 100644 index 000000000..3584aba51 --- /dev/null +++ b/assets/pwsh.manifest @@ -0,0 +1,26 @@ + + + PowerShell Core 6 + + + + + + + + + + + + + + + + + + + + diff --git a/build.psm1 b/build.psm1 index 3a5c99f5f..f793e0097 100644 --- a/build.psm1 +++ b/build.psm1 @@ -616,7 +616,8 @@ Fix steps: Start-NativeExecution { & "~/.rcedit/rcedit-x64.exe" $pwshPath --set-icon "$PSScriptRoot\assets\Powershell_black.ico" ` --set-file-version $fileVersion --set-product-version $ReleaseVersion --set-version-string "ProductName" "PowerShell Core 6" ` - --set-requested-execution-level "asInvoker" --set-version-string "LegalCopyright" "(C) Microsoft Corporation. All Rights Reserved." } | Write-Verbose + --set-version-string "LegalCopyright" "(C) Microsoft Corporation. All Rights Reserved." ` + --application-manifest "$PSScriptRoot\assets\pwsh.manifest" } | Write-Verbose } # download modules from powershell gallery. diff --git a/test/powershell/Host/ConsoleHost.Tests.ps1 b/test/powershell/Host/ConsoleHost.Tests.ps1 index c9844d1a2..caa075e82 100644 --- a/test/powershell/Host/ConsoleHost.Tests.ps1 +++ b/test/powershell/Host/ConsoleHost.Tests.ps1 @@ -662,3 +662,17 @@ Describe "Console host api tests" -Tag CI { } } } + +Describe "Pwsh exe resources tests" -Tag CI { + It "Resource strings are embedded in the executable" -Skip:(!$IsWindows) { + $pwsh = Get-Item -Path "$PSHOME\pwsh.exe" + $pwsh.VersionInfo.FileVersion | Should -BeExactly $PSVersionTable.PSVersion.ToString().Split("-")[0] + "v" + $pwsh.VersionInfo.ProductVersion.Replace("-dirty","") | Should -BeExactly $PSVersionTable.GitCommitId + $pwsh.VersionInfo.ProductName | Should -BeExactly "PowerShell Core 6" + } + + It "Manifest contains compatibility section" -Skip:(!$IsWindows) { + $osversion = [System.Environment]::OSVersion.Version + $psversiontable.os | Should -MatchExactly "$($osversion.Major).$($osversion.Minor)" + } +}