2016-03-04 14:48:30 -08:00
|
|
|
Describe "PSVersionTable" {
|
2015-07-20 17:18:06 -07:00
|
|
|
It "Should have version table entries" {
|
2016-05-18 15:35:09 -07:00
|
|
|
$PSVersionTable.Count | Should Be 9
|
2015-07-20 17:18:06 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
It "Should have the right version table entries" {
|
2016-03-04 14:52:27 -08:00
|
|
|
$PSVersionTable.ContainsKey("PSVersion") | Should Be True
|
|
|
|
|
$PSVersionTable.ContainsKey("PSEdition") | Should Be True
|
|
|
|
|
$PSVersionTable.ContainsKey("WSManStackVersion") | Should Be True
|
|
|
|
|
$PSVersionTable.ContainsKey("SerializationVersion") | Should Be True
|
|
|
|
|
$PSVersionTable.ContainsKey("CLRVersion") | Should Be True
|
|
|
|
|
$PSVersionTable.ContainsKey("BuildVersion") | Should Be True
|
|
|
|
|
$PSVersionTable.ContainsKey("PSCompatibleVersions") | Should Be True
|
|
|
|
|
$PSVersionTable.ContainsKey("PSRemotingProtocolVersion") | Should Be True
|
2016-05-18 15:35:09 -07:00
|
|
|
$PSVersionTable.ContainsKey("GitCommitId") | Should Be True
|
2015-07-20 17:18:06 -07:00
|
|
|
|
|
|
|
|
}
|
2016-05-19 13:19:16 -07:00
|
|
|
It "GitCommitId property should not contain an error" {
|
|
|
|
|
$PSVersionTable.GitCommitId | Should not match "powershell.version"
|
|
|
|
|
}
|
2016-03-04 14:40:33 -08:00
|
|
|
|
|
|
|
|
It "Should have the correct edition" -Skip:(!$IsCore) {
|
2016-03-04 14:52:27 -08:00
|
|
|
$expected =
|
|
|
|
|
if ($IsLinux -Or $IsOSX) {
|
|
|
|
|
"Linux"
|
|
|
|
|
} elseif ($IsWindows) {
|
|
|
|
|
"Core"
|
|
|
|
|
} else {
|
|
|
|
|
throw [PlatformNotSupportedException]
|
|
|
|
|
}
|
2016-03-04 14:40:33 -08:00
|
|
|
|
2016-03-04 14:52:27 -08:00
|
|
|
$PSVersionTable["PSEdition"] | Should Be $expected
|
2016-03-04 14:40:33 -08:00
|
|
|
}
|
2015-07-20 17:18:06 -07:00
|
|
|
}
|