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 {
    $url = "$Name"
    $webclient = New-Object
    $xml = [xml]$webclient.DownloadString($url)

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!