Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • I like the idea, but I can't get it to work. For testing I stored the method in a variable: $Method = "TestWebMethod" and then I tried $proxy.$Method" and nothing happened it just returned to the next line. $proxy | Foreach $Method returned an error. Commented Nov 7, 2013 at 20:27
  • The first approach only works on PowerShell v3. You must on v1 or v2. With the quoted version on V2 do it this way $proxy."$method".Invoke(). Commented Nov 7, 2013 at 21:09
  • Got Error: you cannot call a method on a null valued expression. Commented Nov 7, 2013 at 21:16
  • I would rather do it this way, just because it's simpler, but as of right now I can only get it to work using iex Commented Nov 7, 2013 at 21:17
  • Nevermind, you must be on at least V2 to use New-WebServiceProxy. Weird, I tested on V2 and that approach worked for me. Commented Nov 7, 2013 at 21:24