Posts RSS Comments RSS 249 Posts and 391 Comments till now

Cheesy Christmas Tree Script

I had a few minutes tonight so I decided to have a little fun. I am stopping now before this becomes a new project ;)

Below is the code:

$colors = "cyan","Green","Yellow","Red","magenta","white"

Clear-Host

Write-Host

while($true)
{
    $oldpos = $host.ui.RawUI.CursorPosition
    Write-Host "        *" -ForegroundColor ($colors | get-random)

    # Row One
    Write-Host "       *" -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"        -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"        -ForegroundColor ($colors | get-random)

    # Row Two
    Write-Host "      *" -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random)

    # Row Three
    Write-Host "     *"  -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random)

    # Row Four
    Write-Host "    *"   -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random)

    # Row Five
    Write-Host "   *"    -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random)

    # Row Six
    Write-Host "  *"     -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random) -nonewline
    Write-Host "*"       -ForegroundColor DarkGreen              -nonewline
    Write-Host "*"       -ForegroundColor ($colors | get-random)

    # Stump
    Write-Host "       ***       " -fore DarkGreen
    Write-Host "       ***       " -fore DarkGreen

    $host.ui.RawUI.CursorPosition = $oldpos
    sleep .40
}

Write-Host

2 Responses to “Cheesy Christmas Tree Script”

  1. on 15 Dec 2009 at 1:10 pmAnkit Kashyap

    Really Gud one :)

  2. on 18 Dec 2009 at 3:40 pmSean Kearney

    Hey saw the one from Get-Admin.com and went a little over board. Hope you like it.

    It’s a… a little harsher on the CPU than yours :)

    http://ye110beard.spaces.live.com/blog/cns!952F95CB5DE3F349!2385.entry

    Enjoy Happy Holidays

    Sean
    The Energized Tech
    “Highway to Powershell”

Trackback this post | Feed on Comments to this post

Leave a Reply