Yesterday, posted quietly as KB article 968929, Microsoft officially released PowerShell 2.0
Why is that cool? Because now you can get PoSh 2 officially deployed to all your servers. And you get to “officially” use the coolest CmdLet in the bunch: New-WebServiceProxy
Now, if you were to just read the help about it, it doesn’t really seem all that interesting:
Creates a Web service proxy object that lets you use and manage the Web service in Windows PowerShell.
But I’m going to give you an awesome secret. There’s a webservice out there unlike any other. If you want to sell PoSh to your coworkers, this is the way to do it.
What is it?
WebServiceX.Net provides On Demand XML Web Services for Financial,Distribution, Retail, Health Care, Manufacturing, Telecom, Government and Educational Industry.
So, what’s the mean to us?
Well using our shiny new cmdLet and a few lines of code we can instantly access data for over 70 different services. So really it comes down to “What do you want to do?”
Get the weather? No problem.
$usWeather = New-WebServiceProxy –uri “http://www.webservicex.net/WeatherForecast.asmx?wsdl”
Oh, you don’t live in the US? No worries either.
Lets see how the weather of a certain favorite MS employee is.
$weather = New-WebServiceProxy –uri "http://www.webservicex.net/globalweather.asmx?wsdl”
Wow, Stefan better grab a coat, it’s chilly there.
Ok, those were interesting in an ‘yeah, I’ve seen that before’ way – but what else?
A simple-as-pie domain whois? You know it’s there.
$whois = New-WebServiceProxy –uri “http://www.webservicex.net/whois.asmx?wsdl”
How about searching Lloyd’s for the risk code for a given item. Sure, we got it.
$lloyds = New-WebServiceProxy -uri "http://www.webservicex.net:85/LloydsRiskCodeService.asmx?wsdl"
$lloyds.GetLloydsRiskCodeDetailByRiskCodeDescription('OVERSEAS LEG TERRORISM PROPERTY')
Apparently it’s risk code is 6T. No idea what that all means.
I could go on all day – there is so much information out there. From Acceleration Unit Converters, Sunset and Sunrise times, RSS Readers, Translation services, Barcode generation, Text to Braille – hell, it’ll even let you send Free SMS messages and Faxes to anyone!
As you can tell, it’s a pretty expansive list, with many options and a whole ton of data. Not always what you want when you’re trying to do a little Posh-Fu. So that’s why I’m working on a little script for you to dot source, one that “PoShifies” these various services and gives you a lot more options on the command line – look for that soon!
Oh, and before I forget – be sure to check out the PowerScripting Podcast tomorrow night because you’re in for a treat! Me, Marco Shaw, Marcus Oh and Scott Moss will be giving a little panel discussion about PowerShell in OpsMgr – the Command Shell as we’ve come to call it. So come listen in, ask some questions, and maybe win some sweet sweet schwag!