Primary key type in PS

Apr 4, 2011 at 6:46 AM

I'm creating my own Scaffolders. I encountered need to have type of primary key in PS script. 

But there is only possibility to get name of primary key. And when I tried to convert code that gets type of primary key in T4, I encountered problem in PS, that can't convert from COM object to CodeType.

Is there any way to do this in PS? Or should I limit this functionality in T4 C#.