I do believe that in V2, this will be something that can be done natively within PowerShell. In the meantime, there are a few well documented ways to do this, check out Lee Holmes' example.
I have approached this from a slightly different angle. If you have access to Visual Studio, try something like this:
- Create a console app
- Set a web reference to your predefined web service
- Create your method
- Compile
- Move the exe to the appropriate location and call as needed from PowerShell
A specific example: I have a paging web service that I can call from my automated monitoring PowerShell scripts when certain conditions are met.
If ($cnt -gt 500) { D:\Script:\Paging.exe "9773" "Import Count: $cnt" }
Works like a charm!
No comments:
Post a Comment