Getting Movie Database Information

by Aug 1, 2012

Here's a sample that illustrates how versatile PowerShell is. The function Get-Movie retrieves information about movies from the Internet.

function Get-Movie {
    param($Name)
    
    $url = "http://a.disas.de/ofdbgw/search/$Name"
    $webclient = New-Object system.net.WebClient
    $xml = [xml]$webclient.DownloadString($url)
    $xml.ofdbgw.resultat.eintrag 
}

This function assumes that you have direct Internet access. It does not configure the webclient for proxy access. Here's how you tap into the movie database:

PS> Get-Movie -Name Matrix

The sample is using a URL for a German movie database (the information delivered is still mostly in English).

Twitter This Tip! ReTweet this Tip!