Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 4th, 2012  |  syntax: None  |  size: 0.36 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Why does invoking a Powershell script block return a collection?
  2. $code = {"a"}
  3. $code.Invoke().Gettype().FullName
  4.        
  5. System.Collections.ObjectModel.Collection`1[[System.Management.Automation.PSObject, System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]
  6.        
  7. $code.InvokeReturnAsIs().GetType().FullName
  8.        
  9. System.String