3

I am trying to get Google Chrome's version number but I can't find it.
I can see that chrome is installed: enter image description here

I tried using PowerShell:

get-wmiobject Win32_Product | Format-Table IdentifyingNumber, Name, LocalPackage -AutoSize  

but what I get is a list that doesn't contain "Google Chrome" in it.

How can I get Google Chrome's version number?

1

6 Answers 6

11

you can query the registry key.

(Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe').'(Default)').VersionInfo

its fits your need?

7
  • No :( It doesn't work because that path doesn't exist. The error I get: "Cannot find path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe' because it does not exist."
    – Davis8988
    Sep 22, 2018 at 15:41
  • When you run the following command, can you see google chrome? Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize Sep 22, 2018 at 15:48
  • @SaggieHaim Chrome doesn't use the uninstall regkey. Sep 22, 2018 at 15:53
  • what? when i run both of the cmdlet in my PC it working great. I also use it on my company computers (more then 2K PC's with Win 10 and Win 7) Sep 22, 2018 at 16:03
  • 2
    Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | ? { $_ -match "Chrome" } | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize works for me on W10.
    – Jacob
    Sep 23, 2018 at 21:14
4

You can try using this (run in PowerShell 5.1):

$(Get-Package -Name "Google Chrome").Version
2

Here is a solution using Get-WmiObject:

(Get-WmiObject -Class CIM_DataFile -Filter "Name='C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'" | Select-Object Version).Version
1
  • 1
    Get-WmiObject : Invalid query "select * from CIM_DataFile where Name='C:\\Program Files (x86)\\Google\\Chrome\\Application\\ chrome.exe'" At line:1 char:2 + (Get-WmiObject -Class CIM_DataFile -Filter "Name='C:\\Program Files ( ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Get-WmiObject], ManagementException + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand Oct 8, 2021 at 15:58
1

Assuming Chrome was installed to the default directory, you can use:

$ChromePath = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
[System.Diagnostics.FileVersionInfo]::GetVersionInfo($ChromePath).ProductVersion
2
  • Exception calling "GetVersionInfo" with "1" argument(s): "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" At line:2 char:1 + [System.Diagnostics.FileVersionInfo]::GetVersionInfo($ChromePath).Pro ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : FileNotFoundException Oct 8, 2021 at 15:59
  • The error indicates the file was not found. Change $ChromePath to be the location of wherever you have Chrome installed.
    – dunck
    Oct 12, 2021 at 6:18
0

You can execute Command on windows cmd

wmic datafile where name="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" get Version /value
1
  • ...not from Powershell you can't Oct 8, 2021 at 15:59
0

#Get Chrome product version and send mail if is not the desired one $ChromeDesiredVersion = "103.0.5060.134" $ChromeVI = (Get-Item "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe").VersionInfo $ChromePV = $ChromeVI.ProductVersion

#$lineToWriteInFile.ToString() $lineToWriteInFile = "$hostname,$CDate,$ChromePV"

if( $ChromePV -lt $ChromeDesiredVersion){ Write-Host "wrong version" $lineToWriteInFile = "$hostname,$CDate,$ChromePV" Send-MailMessage -To "Me xxx@yourdomain.xxx" -From "ChromeCheckerChromeChecker@yourdomain.xxx" -Subject "Chrome version: $ChromePV,$hostname" -SmtpServer "smtp.yourdomain.xxx"

}else{ Write-Host "Right version" }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.