get chrome path from registy (#1487)

This commit is contained in:
Aleksandr Chebotov
2020-08-26 19:39:34 +03:00
committed by GitHub
parent 0d8046bb17
commit e9080f8ef6

View File

@@ -17,13 +17,14 @@ Describe "Chrome" {
Context "Browser" { Context "Browser" {
$chromeRegPath = "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe" $chromeRegPath = "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe"
$chromePath = (Get-ItemProperty $chromeRegPath).'(default)'
It "Chrome '<chromeRegPath>' registry path exists" -TestCases @{chromeRegPath = $chromeRegPath} { It "Chrome '<chromeRegPath>' registry path exists" -TestCases @{chromeRegPath = $chromeRegPath} {
$chromeRegPath | Should -Exist $chromeRegPath | Should -Exist
} }
It "Chrome VersionInfo registry value exists" -TestCases @{chromeRegPath = $chromeRegPath} { It "Chrome VersionInfo registry value exists" -TestCases @{chromePath = $chromePath} {
$versionInfo = (Get-Item (Get-ItemProperty $chromeRegPath).'(Default)').VersionInfo $versionInfo = (Get-Item $chromePath).VersionInfo
$versionInfo | Should -Not -BeNullOrEmpty $versionInfo | Should -Not -BeNullOrEmpty
} }
@@ -41,8 +42,10 @@ Describe "Chrome" {
Get-NetFirewallRule -DisplayName BlockGoogleUpdate | Should -Not -BeNullOrEmpty Get-NetFirewallRule -DisplayName BlockGoogleUpdate | Should -Not -BeNullOrEmpty
} }
It "chrome.exe is installed" { It "<chromePath> is installed" -TestCases @{chromePath = $chromePath} {
"${env:ProgramFiles(x86)}\Google\Chrome\Application\chrome.exe" | Should -Exist $chromeName = (Get-Item $chromePath).Name
$chromePath | Should -Exist
$chromeName | Should -BeExactly "chrome.exe"
} }
} }
} }