title: How to call a method with output parameters in PowerShell?
body: <p>I'm working on a script to get started in <a href="http://en.wikipedia.org/wiki/Windows_PowerShell" rel="noreferrer">PowerShell</a>. I'm trying to convert a <a href="http://www.visualbasicscript.com/m_28529/tm.htm" rel="noreferrer">working VBScript script</a> that enumerates mapped network drives on a remote Windows computer.</p>
  
  <p>One of the tasks is to use remote <a href="https://en.wikipedia.org/wiki/Windows_Management_Instrumentation" rel="noreferrer">WMI</a> to read the registry and find the process owner of explorer.exe in order to determine who is logged in. This seems easy enough going by <a href="http://myitforum.com/cs2/blogs/scassells/archive/2008/10/01/powershell-wmi-wql-queries-made-easy-for-remote-wmi-especially-for-sms-2003-or-configmgr-2007.aspx" rel="noreferrer">this guide</a>.</p>
  
  <p>However, the WMI method I need to call is <a href="http://msdn.microsoft.com/en-us/library/aa390460(VS.85).aspx" rel="noreferrer">GetOwner() from Win32_Process</a>, which requires two output parameters to store its return value.</p>
  
  <p>How can I call a method with output parameters? When I try to give it two strings, I get the error: <code>Cannot find an overload for "GetOwner" and the argument count: "2".</code>. The MSDN page says there are two parameters, so I'm not sure what I'm doing wrong.</p>