Find version of Chrome browser in registry

大憨熊 提交于 2019-12-21 21:25:40

问题


How do I get Chrome version using PowerShell? I tried the following query:

(Get-ItemProperty 'HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome').DisplayVersion

This didn't work.


回答1:


This is probably what you want (it reads the version of the executable, not a value from the registry):

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



回答2:


Here is a script to get GC version and save it in a file on a server. Hope you can use it.

#Set file path to store data
$filepathToStoreData = '\\v-server\Reports\O365ver\version.txt'

#Get Hostname
$hostname = Get-Content env:computername

#Get Google Chrome Version
$GCVersionInfo = (Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Window\CurrentVersion\App Paths\chrome.exe').'(Default)').VersionInfo
#Write-Host $GCVersionInfo.ProductVersion
$GCVersion = $GCVersionInfo.ProductVersion

#Add Date and Time
$CDate = Get-Date

$lineToWriteInFile = "$hostname,$GCVersion,$CDate"


#Writeversions in file
$lineToWriteInFile | Out-File -Encoding unicode -Append $filepathToStoreData
$lineToWriteInFile | Out-File -Encoding unicode -Append '´n'



回答3:


You can try following this path:

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

But I think it is easier to read about the Chrome version visiting the "About" Page. It is faster way in any case, visit this link for more info: https://rocketfiles.com/articles/what-version-of-chrome-do-i-have.



来源:https://stackoverflow.com/questions/44975653/find-version-of-chrome-browser-in-registry

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!