Merge pull request #1009 from PowerShell/jimtru-psversion2

update PSVersionTable code to use powershell.version rather than .version…
This commit is contained in:
James Truher [MSFT] committed 2016-05-19 15:20:16 -07:00
commit 51d5491c54
6 files changed
+12 -5

No files matched your search

+3
View File
@@ -15,3 +15,6 @@ install.ps1
# We copy powershell.exe as a content in host dotnet cli projects
*.exe
# ignore the version file as it is generated at build time
powershell.version
+1 -1
View File
@@ -53,7 +53,7 @@ function Start-PSBuild {
[string]$msbuildConfiguration = "Release"
)
git describe --dirty --abbrev=60 > "$psscriptroot/.version"
git describe --dirty --abbrev=60 > "$psscriptroot/powershell.version"
# simplify ParameterSetNames
if ($PSCmdlet.ParameterSetName -eq 'FullCLR') {
@@ -19,7 +19,7 @@
"Modules",
"../Modules",
"powershell.exe",
"../../.version"
"../../powershell.version"
],
"frameworks": {
@@ -82,12 +82,12 @@ namespace System.Management.Automation
return new Version(buildVersion);
}
// Get the commit id from the .version file. If the .version file doesn't exist, use the string "N/A"
// Get the commit id from the powershell.version file. If the powershell.version file doesn't exist, use the string "N/A"
static internal string GetCommitInfo()
{
try {
string assemblyPath = IO.Path.GetDirectoryName(typeof(PSVersionInfo).GetTypeInfo().Assembly.Location);
return (IO.File.ReadAllLines(IO.Path.Combine(assemblyPath,".version"))[0]);
return (IO.File.ReadAllLines(IO.Path.Combine(assemblyPath,"powershell.version"))[0]);
}
catch (Exception e){
return e.Message;
+2 -1
View File
@@ -19,7 +19,8 @@
"../Modules",
"*_profile.ps1",
"*.so",
"*.dylib"
"*.dylib",
"../../powershell.version"
],
"frameworks": {
+3
View File
@@ -15,6 +15,9 @@ Describe "PSVersionTable" {
$PSVersionTable.ContainsKey("GitCommitId") | Should Be True
}
It "GitCommitId property should not contain an error" {
$PSVersionTable.GitCommitId | Should not match "powershell.version"
}
It "Should have the correct edition" -Skip:(!$IsCore) {
$expected =