I have a nice little powershell script that works
$URL = $args[0]
$proxy = New-WebServiceProxy -Uri $URL -Namespace webservice -UseDefaultCredential
$result = $proxy.TestWebMethod()
usage from cmd:
powershell.exe myscript.ps1 "http://somesite.com/someservice.asmx"
What I want to do is also be able to pass in the method name dynamically, something to the effect of:
$URL = $args[0]
$proxy = New-WebServiceProxy -Uri $URL -Namespace webservice -UseDefaultCredential
$result = $proxy.$args[1]
usage from cmd:
powershell.exe myscript.ps1 "http://somesite.com/someservice.asmx" "TestWebMethod"
Is there some way to make it work dynamically the second way?