Powershell 99 bottles of beer

This is my submission for http://99-bottles-of-beer.net/ in the powershell category. The site uses the song 99 bottles of beer to show code examples of 1500 languages and variations according to the website. Very cool, lets see if they like my simple implementation.

CLS
$i = (99..1)
Foreach ($b in $i) {
    If ($b -ge 2) {
        Write-Host $b "bottles of beer on the wall," $b "bottles of beer."
        Write-Host "Take one down, pass it around,"($b - 1)"bottles of beer on the wall"
        Write-Host
    }
    Else {
        Write-Host $b "bottle of beer on the wall," $b "bottle of beer."
        Write-Host "Take one down, pass it around, no more bottles of beer on the wall"
        Write-Host
        Write-Host "No more bottles of beer on the wall, no more bottles of beer. "
        Write-Host "Go to the store and buy some more, 99 bottles of beer on the wall."
    }
}
Advertisements