How to get the value of currently installed MS Word version using PowerShell?

Ask your Windows PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
ITEngineer
Posts: 138
Joined: Wed Oct 12, 2011 10:52 am

How to get the value of currently installed MS Word version using PowerShell?

Post by ITEngineer » Wed Aug 08, 2018 12:34 am

Hi People,

I tried to get the value of the registry entry Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Word.Application\CurVer (Default) with this command:

Code: Select all

Get-ItemProperty -Path 'HKLM:Software\Classes\Word.Application\CurVer'.(default)
But not sure how to get the returned value?
(default) : Word.Application.16
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\Software\Classes\Word.Application\CurVer
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\Software\Classes\Word.Application
PSChildName : CurVer
PSDrive : HKLM
PSProvider : Microsoft.PowerShell.Core\Registry
How to correct my Powershell script above?

Thanks in advance.
/* IT Engineer */

User avatar
jvierra
Posts: 13292
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: How to get the value of currently installed MS Word version using PowerShell?

Post by jvierra » Wed Aug 08, 2018 4:34 am

(Get-ItemProperty HKLM:Software\Classes\Word.Application\CurVer).'(default)'

User avatar
ITEngineer
Posts: 138
Joined: Wed Oct 12, 2011 10:52 am

Re: How to get the value of currently installed MS Word version using PowerShell?

Post by ITEngineer » Wed Aug 08, 2018 3:56 pm

jvierra wrote:
Wed Aug 08, 2018 4:34 am
(Get-ItemProperty HKLM:Software\Classes\Word.Application\CurVer).'(default)'
Cool, many thanks for the assistance in this matter Mr. Vierra. :D
/* IT Engineer */

User avatar
jvierra
Posts: 13292
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: How to get the value of currently installed MS Word version using PowerShell?

Post by jvierra » Wed Aug 08, 2018 4:38 pm

Yu almost had it. You were only off by one.

Locked