I'm trying to code something in an install.ps1 post-install script for a Nuget package that depends on the project type. If it's a web project type, I want to do something different after install. So I'm looking at the $project.Kind to determine this. The problem is that when I test with a WebApi project, this always returns the wrong project kind. If you look in a newly created C# WebApi project, it has two project types listed in the element (one for Web Application and one for general C#). The $project.Kind property is returning the C# identifier...I need to see if it's a web application, so I need the first one as well. I can't find the proper call to get the list of all project types from $project:
param($installPath, $toolsPath, $package, $project)
if($project.Kind -eq {guid goes here}){do my custom thing here...}
I've looked through the available accessors on the EnvDte Project object and can't find anything that looks promising.
https://msdn.microsoft.com/en-us/library/envdte.project.aspx
Any ideas?
<Import>s. Web projects appear to includeMicrosoft.WebApplication.targets. Could also look forweb.config.