Summary: Use Windows PowerShell to read a registry key property value.
How can I use Windows PowerShell to read a registry key property value so I can find the version of a particular software package?
Use the Get-ItemProperty cmdlet, for example:
Get-ItemProperty -Path HKCU:\Software\ScriptingGuys\Scripts -Name version
This may resturn better results depending on the property
Get-ItemPropertyProperty -Path HKCU:\Software\ScriptingGuys\Scripts -Name version
As an example I was looking for a correct Windows Build number which at first should be
[System.Environment]::OSVersion.Version
The issue I had was with Windows returning a 0 for revision on the Revision property when I knew I had installed service packs that should have updated the build.
In my case I found that the Registry Key "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\" Ccontained much more information...
This may resturn better results depending on the property
Get-ItemPropertyProperty -Path HKCU:\Software\ScriptingGuys\Scripts -Name version
As an example I was looking for a correct Windows Build number which at first should be
[System.Environment]::OSVersion.Version
The issue I had was with Windows returning a 0 for revision on the Revision property when I knew I had installed service packs that should have updated the build.
In my case I found that the Registry Key "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\" Ccontained much more information...