<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Controlling Virtual Server through Microsoft PowerShell</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/01/22/controlling-virtual-server-through-microsoft-powershell.aspx</link><description>In his post by the same name , Ben describe a series of steps required in order to manipulate Virtual Server from PowerShell. I'm still a PowerShell novice, so I decided to use this problem as an opportunity to see if I could make things a little easier.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Speedlinking #702 - SCVMM, Powershell, and VHD program</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/01/22/controlling-virtual-server-through-microsoft-powershell.aspx#1545290</link><pubDate>Sun, 28 Jan 2007 07:14:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1545290</guid><dc:creator>Dugie's Pensieve</dc:creator><description>&lt;p&gt;Speedlinking #702 - SCVMM, Powershell, and the VHD program Here are some general Virtualization news...&lt;/p&gt;
</description></item><item><title>re: Controlling Virtual Server through Microsoft PowerShell</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2007/01/22/controlling-virtual-server-through-microsoft-powershell.aspx#1562356</link><pubDate>Wed, 31 Jan 2007 09:52:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1562356</guid><dc:creator>Lee</dc:creator><description>&lt;p&gt;That's a good way to do it. In fact, for simple P/Invoke calls, you might also consider the Invoke-Win32 library I wrote some time back, or the inline C# library I wrote:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.leeholmes.com/blog/GetTheOwnerOfAProcessInPowerShellPInvokeAndRefOutParameters.aspx"&gt;http://www.leeholmes.com/blog/GetTheOwnerOfAProcessInPowerShellPInvokeAndRefOutParameters.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.leeholmes.com/blog/MorePInvokeInPowerShell.aspx"&gt;http://www.leeholmes.com/blog/MorePInvokeInPowerShell.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.leeholmes.com/blog/LibraryForInlineCInMSH.aspx"&gt;http://www.leeholmes.com/blog/LibraryForInlineCInMSH.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I believe this should work for the invoke -- I don't have the virtual server manager COM object to test with, though.&lt;/p&gt;
&lt;p&gt;$parameterTypes = [IntPtr], [uint32], [uint32], [uint32], [uint32], [uint32], [IntPtr], [uint32]&lt;/p&gt;
&lt;p&gt;$idispatch = [System.Runtime.InteropServices.Marshal]::GetIDispatchForObject($objDcom)&lt;/p&gt;
&lt;p&gt;$parameters = [IntPtr] $idispatch, [Uint32] 10, [UInt32] 0, [UInt32] 0, [UInt32] 0, [Uint32] 3, [IntPtr]::Zero, [Uint32] 0&lt;/p&gt;
&lt;p&gt;Invoke-Win32 &amp;quot;ole32&amp;quot; ([Int]) &amp;quot;CoSetProxyBlanket&amp;quot; $parameterTypes $parameters&lt;/p&gt;</description></item></channel></rss>