Detecting Version/Edition of Visual Studio

Topics: General
Sep 24, 2012 at 6:45 PM

Is it possible to detect version and edition of Visual Studio (perhaps from the init.ps1 script?) and gracefully abort package installation if they don't meet package requirements?


Sep 24, 2012 at 10:00 PM

You can detect VS version with the DTE.Version property, and edition with DTE.Edition.

If you want to abort package installation from inside init.ps1, just throw an exception.

Sep 25, 2012 at 1:14 AM

Thanks! Would it be correct to assume that the $DTE variable is always initialized in the init.ps1?

Sep 25, 2012 at 1:34 AM