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