I find myself doing a small program the core of which seemed to me to be ideally done in Powershell but to do so I had to solve the problem of how to use Powershell to access Content Web Services. Powershell does have the ability to consume .Net web services but there are a few small typing problems that have to be over come. Anyway, I watched that fine OT Webinar that Jason Smith did last November and decided that the first example of "GetAllFavourites" was the one to tackle.
Now while I learned a lot about CWS from that webinar (thanks Jason!) what I also learned was that C# sure made that simple problem into a large client. I think the following is essentially equivalent, including error code, but it is certainly smaller. Powershell is the best thing Microsoft has done in 10 years, the whole program is 35 lines long.
$user="Test"$pass="livelink" #'pssword that does not contain any quotes (or properly escapes quotes using backtick)'try {$dm = New-WebServiceProxy -Uri "http://localhost/les-services/DocumentManagement.svc?wsdl"}catch { Write-Error "Could not connect to http://localhost/les-services/DocumentManagement.svc because $error[0].Exception" return 1 }try {$auth= New-WebServiceProxy -Uri "http://localhost/les-services/Authentication.svc?wsdl"}catch { Write-Error "Could not connect to http://localhost/les-services/Authentication.svc" return 2 } $token = $auth.AuthenticateUser($user, $pass)if ( $token -eq $NULL) { Write-Error "Did not get authentication token because $error[0].Exception" return 3 }try {$tmp = $dm.getType().namespace}catch { Write-Error "Error Cannot access method dm.getType $error[0].Exception" return 4}$att = New-Object($tmp + ".OTAuthentication")$att.AuthenticationToken = $token$dm.OTAuthenticationValue = $atttry {$resp = $dm.GetAllFavorites()}catch { Write-Error "Cannot getAllFavourites because $error[0].Exception" return 5}$resp