Add to Technorati Favorites
Welcome to ThePowerShellGuy.com Sign in | Join | Help

Scripting Games 2008 Beginners Windows PowerShell Event 6

Event 6: Coffee Break I liked this one, mine with sugar and cream please ! :

$drinks = @{Espresso=0;Latte=0;Cappuccino=0}
gc c:\scripts\Coffee.txt |% {$d,$c = $_.split();$drinks."$d" += $c}
$drinks.Remove('Office')
$drinks | ft -h

 

PoSH> .\event6b.ps1                                                                                                     
                                                                                                                        
Espresso                       13                                                                                       
Latte                          22                                                                                       
Cappuccino                     18                                                                                       
                                                                                                                        
                                                                                                                        
PoSH>                                                                                     

 

Enjoy,

Greetings /\/\o\/\/

Published Tuesday, February 26, 2008 4:07 PM by MoW

Comments

# re: Scripting Games 2008 Beginners Windows PowerShell Event 6

Wow!!.. Fantastic blog about PowerShell

I'm also participe in the 2008 Scripting Games!! but I'm in the Bennigers VBScript :D.

Well I'll visit that blog more frequently.

See you ;)

Wednesday, February 27, 2008 10:09 AM by

# 2008 Scripting Games - Solution for Beginner’s Event 6

Friday, February 29, 2008 8:23 PM by 2008 Scripting Games - Solution for Beginner’s Event 6
Anonymous comments are disabled