New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable [Environment]::OSVersion to return current OS rather than compatible version #6457

Merged
merged 5 commits into from Mar 28, 2018
Next

add application manifest dictating compatibility so that osversion sh…

…ows appropriate os version on Windows
  • Loading branch information...
SteveL-MSFT committed Mar 21, 2018
commit 9802e2ce71fd328b0d9c5f964793fd251e4f7226
Copy path View file
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<description> PowerShell Core 6 </description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"
/>
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
</application>
</compatibility>
</assembly>
Copy path View file
@@ -630,7 +630,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

This comment has been minimized.

@iSazonov

iSazonov Mar 23, 2018

Collaborator

I see pwsh.1.manifest in assert directory.

This comment has been minimized.

@SteveL-MSFT

SteveL-MSFT Mar 27, 2018

Member

Will fix

This comment has been minimized.

@SteveL-MSFT

SteveL-MSFT Mar 27, 2018

Member

surprised this wasn't caught in CI unless rcedit tries looking for pwsh.1.manifest

}
# download modules from powershell gallery.
@@ -663,3 +663,18 @@ 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
$pwsh.VersionInfo.ProductVersion.Replace("-dirty","") | Should -BeExactly $PSVersionTable.GitCommitId.Replace("v","")
$pwsh.VersionInfo.ProductName | Should -BeExactly "PowerShell Core 6"
}
It "Manifest contains compatibility section" -Skip:(!$IsWindows) {
$osversion = [System.Environment]::OSVersion.Version
$osversionString = $psversiontable.os -replace "^Microsoft Windows (\d+\.\d+).*$",'$1'
"$($osversion.Major).$($osversion.Minor)" | Should -BeExactly $osversionString

This comment has been minimized.

@iSazonov

iSazonov Mar 23, 2018

Collaborator

Maybe use Should -Match

$psversiontable.os | Should -Match "$($osversion.Major).$($osversion.Minor)" 

This comment has been minimized.

@SteveL-MSFT

SteveL-MSFT Mar 27, 2018

Member

This is simpler, will change

}
}
ProTip! Use n and p to navigate between commits in a pull request.