I want to get the installation directories of all Visual Studio versions installed on a machine (to copy a file into the Xml/Schemas directory)
The best way is to read from the registry. At \HKLM\Software\Wow6432Node\Microsoft\Visual Studio
, all the versions are listed by version number: 10.0, 11.0, 12.0. However, 9.0 and 8.0 and 7.1 are still there, even though those aren't installed. So I can't just grab them all. What I need is to filter on all keys that have the InstallDir property.
I know I have to combine Get-ChildItem and Get-ItemProperty but I'm not sure how.
How do I write the Powershell command for what I'm asking?