Created
May 21, 2016 04:10
-
-
Save MSAdministrator/d40ecf05a30790f9979f9858c21cb993 to your computer and use it in GitHub Desktop.
comObject.types.ps1xml
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
<!-- | |
Copy from: Abhishek's PowerShell Blog - http://abhishek225.spaces.live.com/blog/ | |
Original post: http://abhishek225.spaces.live.com/blog/cns!13469C7B7CE6E911!165.entry | |
--> | |
<Types> | |
<Type> | |
<Name>System.__ComObject</Name> | |
<Members> | |
<ScriptMethod> | |
<Name>GetProperty</Name> | |
<Script> | |
$type = $this.gettype(); | |
$type.invokeMember($args[0],[System.Reflection.BindingFlags]::GetProperty,$null,$this,$null) | |
</Script> | |
</ScriptMethod> | |
<ScriptMethod> | |
<Name>SetProperty</Name> | |
<Script> | |
$type = $this.gettype(); | |
$type.invokeMember($args[0],[System.Reflection.BindingFlags]::GetProperty,$null,$this,@($args[1])) | |
</Script> | |
</ScriptMethod> | |
<ScriptMethod> | |
<Name>InvokeParamProperty</Name> | |
<Script> | |
$type = $this.gettype(); | |
$index = $args.count -1 ; | |
$methodargs=$args[1..$index] | |
$type.invokeMember($args[0],[System.Reflection.BindingFlags]::GetProperty,$null,$this,$methodargs) | |
</Script> | |
</ScriptMethod> | |
<ScriptMethod> | |
<Name>InvokeMethod</Name> | |
<Script> | |
$type = $this.gettype(); | |
$index = $args.count -1 ; | |
$methodargs=$args[1..$index] | |
$type.invokeMember($args[0],[System.Reflection.BindingFlags]::InvokeMethod,$null,$this,$methodargs) | |
</Script> | |
</ScriptMethod> | |
</Members> | |
</Type> | |
</Types> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment