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

Browse by Tags

All Tags » Scripting games   (RSS)

Scripting Games 2008 Beginners Windows PowerShell Event 10

And to end the series with solutions, Beginners event 10, this was a nice one, I started out with a straight loop but to handle 2 or 3 strikes in a row I considered that it might be easier to look back and forwards in the array. a Pro was that this would
Posted by MoW | 0 Comments

Scripting Games 2008 Beginners Windows PowerShell Event 9

My solution for Event 9 in the beginners competition, as Jaykul already noted here : 2008 Scripting Games - Solution for Advanced Event 2 , when working with ADO in PowerShell it's much better to use .NET to connect to a database as the COM objects shown
Posted by MoW | 2 Comments

Scripting Games 2008 Advanced Windows PowerShell Event 9

My solution for event 9 :   (gc c:\scripts\alice.txt |% { $_ .split()} |% { $_ [ - 1 ..( - $_ .length)] - join '' }) - join ' ' Enjoy, Greetings /\/\o\/\/
Posted by MoW | 2 Comments

Scripting Games 2008 Advanced Windows PowerShell Event 10

My Windows PowerShell solution for event 10 is posted on the scriptcenter. By accident ( I did send a "preview" version to confuse the scripting guys check if format was right), it was not the latest version that got posted, I made some small changes
Posted by MoW | 2 Comments
Attachment(s): event10.ps1

Scripting Games 2008 Sudden Death Challenge Event 9

As the Scripting Guys note here Event 9 Solution , this was a simple event, biggest part of the code is the filename. (gc c:\scripts\Symbols.txt) -replace '[^\w\s]|_','' Only issue I had is as I use \w (word characters) and this also included the underscores
Posted by MoW | 0 Comments

PowerShell out-random function

Bruno left a comment on the post about my solution for Scripting Games 2008 Advanced Windows PowerShell Event 7 about my sort routine, using a scriptblock could make it even simpler, and so elegant I decided to make an extra post about it, a generic randomize
Posted by MoW | 3 Comments

Scripting Games 2008 Sudden Death Challenge Event 8

Event 8 was a Quiz again, asking for AD property names, to check this I simply made the user in AD Users and Computers and checked the properties that where set after from PowerShell. But I had a problem with the Country / Region as USA as given in the
Posted by MoW | 2 Comments
Attachment(s): ken.png

Scripting Games 2008 Advanced Windows PowerShell Event 8

And for event 8, I cheated a bit here , I started out with sorting the files descending, thinking to fix big song first and then look for small ones to fit in, this already gave me more as 75 minutes, but then when testing I sorted them normally ( Small
Posted by MoW | 2 Comments

Scripting Games 2008 Sudden Death Challenge Event 6

Altought the -replace operator does not support scriptblocks yet ( We keep on begging ;-) ) , the Switch -regex was a nice alternative in this case : ([string[]][char[]](gc c:\scripts\Lettercase.txt) |% { Switch -regex -casesensitive ($_) { '[A-Z]' {$_.tolower()}
Posted by MoW | 1 Comments

Scripting Games 2008 Sudden Death Challenge Event 7

For Sudden death Event 7 , I just post part of my history (get-history ) 18 100 * 2 19 100 * 2 /30 20 [int](100 * 2 /30) 21 pow([int](100 * 2 /30),5) 22 [math]::pow([int](100 * 2 /30),5) 23 [math]::pow([int](100 * 2 /30),5) * 4 24 [math]::Sqrt([math]::pow([int](100
Posted by MoW | 1 Comments

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
Posted by MoW | 2 Comments

Scripting Games 2008 Beginners Windows PowerShell Event 5

My solution for Beginners Event 5: What’s the Difference   (that I forgot to send in ) :   PARAM([datetime] $date = ' March 3, 2009 ' ) $now = [datetime]::Today $d = ( $date - $now ).days " Days: $d " $m = ( $date .year - $now
Posted by MoW | 1 Comments

Scripting Games 2008 Advanced Windows PowerShell Event 5

Also on this event I was a bit lazy and mostly copied and pasted the lines. PARAM ( $Password ) $wl = gc c:\scripts\WordList.txt $Score = 13 & { if ( $wl -contains $password ) { Write-warning " Password is word " ; $score -- ; return } if
Posted by MoW | 1 Comments

Scripting Games 2008 Advanced Windows PowerShell Event 6

My solution to Advanced event 6 2;2..200 |? {$i=$_;(2..($i -1) |% {$i%$_}) -notcontains 0} Warning, I really went Brute Force here, this is probably the most ineffective way to do this : PoSH> 2 ; 2 .. 200 | ? { $i = $_ ; ( 2 .. ( $i - 1 ) | % { $i
Posted by MoW | 11 Comments

Scripting Games 2008 Sudden Death Challenge Event 4

My Solution for Sudden Death Challenge: Event 4 ([regex]::matches((gc c:\scripts\numbers.txt),'\d{2}')|%{[char][int]$_.value})-join'' Enjoy, Greetings /\/\o\/\/
Posted by MoW | 1 Comments
More Posts Next page »