PowerShell 2.0 CTP: How to get the types for a given namespace

Software

This handy little trick allows you to find out all the types that are defined for a specific namespace. If, like me, you’re using PowerShell to interact with custom DLLs, quite often you have hundreds of types defined. This script (and its variations) allows you to narrow down the list a bit when you’re searching.

var $dll = [Reflection.Assembly]::LoadFrom("$pwd\your.dll")
$dll.GetExportedTypes() | ? {$_.Namespace -eq "Your.Namespace" } | select Name, Namespace

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Furl
  • Ma.gnolia
  • Reddit
  • TwitThis
No Comments

Leave a Reply

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">