title: Function return value in PowerShell
body: <p>I have developed a PowerShell function that performs a number of actions involving provisioning <a href="http://en.wikipedia.org/wiki/Microsoft_SharePoint" rel="noreferrer">SharePoint</a> Team sites. Ultimately, I want the function to return the URL of the provisioned site as a String so at the end of my function I have the following code:</p>
  
  <pre><code>$rs = $url.ToString();
  return $rs;
  </code></pre>
  
  <p>The code that calls this function looks like:</p>
  
  <pre><code>$returnURL = MyFunction -param 1 ...
  </code></pre>
  
  <p>So I am expecting a String, however it's not. Instead, it is an object of type System.Management.Automation.PSMethod. Why is it returning that type instead of a String type?</p>