Just sharing some of my inconsequential lunch conversations with you... RSS  

Saturday, November 18, 2006

For much that I hatted Monad..

Let's start making sure I make my self clear: I still hate the Windows Powershell. Probably because each time I think about Monad, silly scripting languages like bash and VBScript come to my mind. And surely because I hate the easiness that is sold with these technologies, on which I don't believe. Did I mention I also hate the over-simplification and sourcecode savings that annoy me so much?

But as much anti PowerShell as I am, I could't help test driving it. Here's the story:

When I VPN to my company, I usually maintain my previous gateway and add the routing entries I need to work on my company's network. So I decided to do automate the operation using the Powershell. Here's the script:



#
# start VPN
#

RASDIAL "myVPN"

#
# get my VPN IP
#

$colItems = get-wmiobject -class "Win32_NetworkAdapterConfiguration" -computername .
$myIP = ""

foreach ($objItem in $colItems)
{
if ($objItem.Description -like "*PPP*")
{
$myIP = $objItem.IPAddress
}
}

write-host "my IP: " $myIP

#
# establish necessary manual routing
#

route add mySubnet0 MASK 255.255.255.0 $myIP
route add
mySubnet1 MASK 255.255.255.0 $myIP
route add
mySubnet2 MASK 255.255.255.0 $myIP






My conclusion is: for most silly Monad seems to be, there is a really need for scripting in this area. And for much it bothers me, not only to the IT people...

No comments:

Development Catharsis :: Copyright 2006 Mário Romano