Char(DesertFish)

A desert-fish want to go heaven.

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

cls
$currentDomain = [AppDomain]::CurrentDomain
#[AppDomain]::CurrentDomain.GetAssemblies()\

#Finding Interesting Classes (Types)
$searchtext = "*Environment*"
$interstingClass = [AppDomain]::CurrentDomain.GetAssemblies() |
ForEach-Object { $_.GetExportedTypes() } |
Where-Object { $_ -like $searchtext } |
ForEach-Object { $_.FullName }

#Looking for the method
$searchtext = "*getfolder*"
$InterestingMethod = [AppDomain]::CurrentDomain.GetAssemblies() |
ForEach-Object { $_.GetExportedTypes() } |
ForEach-Object { $_.getmembers() } |
Where-Object { $_.isStatic} |
Where-Object { $_ -like $searchtext } |
ForEach-Object { "[{0}]::{1} --> {2}" -f `
$_.declaringtype, $_.toString().SubString( `
$_.toString().IndexOf(" ")+1), $_.ReturnType }

#list the static method
$interestingStaticMethod = [System.Environment] | Get-Member -static

#$currentDomain
#$interstingClass
$InterestingMethod
#$interestingStaticMethod

posted on 2010-12-16 16:20  沙漠鱼  阅读(195)  评论(0编辑  收藏  举报