Last active
April 9, 2017 20:29
-
-
Save gpduck/fd4c2a14b56c18dcbfc0fa13662742a7 to your computer and use it in GitHub Desktop.
I made a wrapper for your .Net method calls so you can test...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[System.AppDomain]::CurrentDomain.GetAssemblies().ExportedTypes | %{ | |
$Type = $_ | |
$Type.GetMethods() | Select -Unique Name | %{ | |
$Method = $_ | |
$Name = "Invoke-{0}.{1}" -f $Type.Fullname, $Method.Name | |
@" | |
function $Name { | |
param( | |
[Parameter(Mandatory=`$True,ValueFromPipeline=`$True)] | |
`$InputObject, | |
[Object[]]`$Parameters | |
) | |
`$InputObject."$($Method.Name)"(`$Parameters) | |
} | |
"@ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment