From f223f05538d2f2e27433cc4562e691c979566ebc Mon Sep 17 00:00:00 2001 From: Devlin Cashman Date: Tue, 21 Apr 2020 19:34:56 -0400 Subject: [PATCH 1/9] Add missing $array variable --- PSKoans/Koans/Foundations/AboutArrays.Koans.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/PSKoans/Koans/Foundations/AboutArrays.Koans.ps1 b/PSKoans/Koans/Foundations/AboutArrays.Koans.ps1 index 7a361bea0..385058e34 100644 --- a/PSKoans/Koans/Foundations/AboutArrays.Koans.ps1 +++ b/PSKoans/Koans/Foundations/AboutArrays.Koans.ps1 @@ -194,6 +194,7 @@ Describe 'Arrays' { } It 'can reverse an array' { + $Array = 1, 2, 3, 4, 5, 6, 7 $LastIndex = __ $Array[-1..$LastIndex] | Should -Be @(7, 6, 5, 4, 3, 2, 1) } From f9a17b30a32618e4a037915aed2f0f76fa5bdee2 Mon Sep 17 00:00:00 2001 From: Devlin Cashman Date: Fri, 8 May 2020 23:04:14 -0400 Subject: [PATCH 2/9] hashtables test error --- PSKoans/Koans/Foundations/AboutHashtables.Koans.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PSKoans/Koans/Foundations/AboutHashtables.Koans.ps1 b/PSKoans/Koans/Foundations/AboutHashtables.Koans.ps1 index a8ccd1ac4..69189ebd3 100644 --- a/PSKoans/Koans/Foundations/AboutHashtables.Koans.ps1 +++ b/PSKoans/Koans/Foundations/AboutHashtables.Koans.ps1 @@ -180,7 +180,7 @@ Describe 'Hashtables' { $Hashtable.ContainsValue('Fruit') | Should -BeTrue $Hashtable['Oranges'] | Should -Be 'Fruit' - $Hashtable['Carrots'] | Should -Not -Be $Hashtable['Oranges'] + $Hashtable['Carrots'] | Should -Be $Hashtable['Oranges'] } It 'will not implicitly convert keys and lookup values' { From 0ef8ae7d229e40c6a1232073e425b4b758359591 Mon Sep 17 00:00:00 2001 From: Devlin Cashman Date: Fri, 8 May 2020 23:41:48 -0400 Subject: [PATCH 3/9] test already filled out --- PSKoans/Koans/Foundations/AboutLoopsAndPipelines.Koans.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PSKoans/Koans/Foundations/AboutLoopsAndPipelines.Koans.ps1 b/PSKoans/Koans/Foundations/AboutLoopsAndPipelines.Koans.ps1 index b8c5674b1..f57ba1a61 100644 --- a/PSKoans/Koans/Foundations/AboutLoopsAndPipelines.Koans.ps1 +++ b/PSKoans/Koans/Foundations/AboutLoopsAndPipelines.Koans.ps1 @@ -125,7 +125,7 @@ Describe 'Pipelines and Loops' { #> $i } - $Values | Should -Be @(0, 1, 2, 3, 4) + $Values | Should -Be __ } It 'can loop while a condition is $true' { From cd15715370782ccec4f4321285b68cbd7c68d27e Mon Sep 17 00:00:00 2001 From: Devlin Cashman Date: Sat, 9 May 2020 01:24:09 -0400 Subject: [PATCH 4/9] add more descriptive hint --- PSKoans/Koans/Katas/ProcessingStrings.Koans.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PSKoans/Koans/Katas/ProcessingStrings.Koans.ps1 b/PSKoans/Koans/Katas/ProcessingStrings.Koans.ps1 index 02744b3ac..3f6de59f8 100644 --- a/PSKoans/Koans/Katas/ProcessingStrings.Koans.ps1 +++ b/PSKoans/Koans/Katas/ProcessingStrings.Koans.ps1 @@ -15,7 +15,8 @@ param() [double] $value # Casts (converts) the value into numerical data $String -split ',' # Creates an array by splitting the string - Be sure to review AboutStrings and AboutArrays if you need to! + Be sure to review AboutStrings, AboutArrays and the other foundation Koans + you've done so far if you get stuck or need help! #> Describe "The Stock Challenge" { BeforeAll { From 791687fd1115ae92a8e8ef158841c6e01a95c877 Mon Sep 17 00:00:00 2001 From: Devlin Cashman Date: Sat, 9 May 2020 03:47:16 -0400 Subject: [PATCH 5/9] fails a simple sort, merge sort too advanced --- PSKoans/Koans/Katas/SortingCharacters.Koans.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PSKoans/Koans/Katas/SortingCharacters.Koans.ps1 b/PSKoans/Koans/Katas/SortingCharacters.Koans.ps1 index 7a9c2d953..7b6123f1c 100644 --- a/PSKoans/Koans/Katas/SortingCharacters.Koans.ps1 +++ b/PSKoans/Koans/Katas/SortingCharacters.Koans.ps1 @@ -67,11 +67,11 @@ Describe 'Kata - Sorting Characters' { } @{ String = 'What do you call the world?' - Result = 'aacddehhlllooorttuwWy' + Result = 'aacddehhlllooorttuWwy' } @{ String = 'Out of nowhere, the mind comes forth.' - Result = 'cdeeeeffhhhimmnnooOoorrstttuw' + Result = 'cdeeeeffhhhimmnnOoooorrstttuw' } @{ String = 'Because it is so very clear, it takes longer to come to the realization.' @@ -79,11 +79,11 @@ Describe 'Kata - Sorting Characters' { } @{ String = 'The hands of the world are open.' - Result = 'aaddeeeefhhhlnnoooprrstTw' + Result = 'aaddeeeefhhhlnnoooprrsTtw' } @{ String = 'You are those huge waves sweeping everything before them, swallowing all in their path.' - Result = 'aaaaabeeeeeeeeeeeefgggghhhhhhiiiiillllmnnnnoooopprrrrsssstttttuuvvwwwwyY' + Result = 'aaaaabeeeeeeeeeeeefgggghhhhhhiiiiillllmnnnnoooopprrrrsssstttttuuvvwwwwYy' } ) } From cf2a92ce8a56164a744fc999d21d834b6d13f3e9 Mon Sep 17 00:00:00 2001 From: Devlin Cashman Date: Sat, 9 May 2020 04:33:04 -0400 Subject: [PATCH 6/9] issues with shell console, smaller sample to avoid --- PSKoans/Koans/Cmdlets 1/AboutDiscovery.Koans.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PSKoans/Koans/Cmdlets 1/AboutDiscovery.Koans.ps1 b/PSKoans/Koans/Cmdlets 1/AboutDiscovery.Koans.ps1 index 321f74c4a..ed1875254 100644 --- a/PSKoans/Koans/Cmdlets 1/AboutDiscovery.Koans.ps1 +++ b/PSKoans/Koans/Cmdlets 1/AboutDiscovery.Koans.ps1 @@ -177,8 +177,8 @@ Describe 'Get-Command' { It 'lists available commands' { # Try calling Get-Command in a PowerShell console to see the typical output! - $CommandCount = Get-Command | Measure-Object | Select-Object -ExpandProperty Count - __ | Should -Be $CommandCount + $Commands = Get-Command | Where-Object { $_ -like 'Write-*' } + __ | Should -Be $Commands.Count Get-Command | Select-Object -First 1 -ExpandProperty Name | Should -Be '____' } From bab8763dce2745e118526e90582bdbc987fbb835 Mon Sep 17 00:00:00 2001 From: Devlin Cashman Date: Sat, 9 May 2020 04:34:39 -0400 Subject: [PATCH 7/9] confusing change --- PSKoans/Koans/Cmdlets 1/AboutDiscovery.Koans.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PSKoans/Koans/Cmdlets 1/AboutDiscovery.Koans.ps1 b/PSKoans/Koans/Cmdlets 1/AboutDiscovery.Koans.ps1 index ed1875254..321f74c4a 100644 --- a/PSKoans/Koans/Cmdlets 1/AboutDiscovery.Koans.ps1 +++ b/PSKoans/Koans/Cmdlets 1/AboutDiscovery.Koans.ps1 @@ -177,8 +177,8 @@ Describe 'Get-Command' { It 'lists available commands' { # Try calling Get-Command in a PowerShell console to see the typical output! - $Commands = Get-Command | Where-Object { $_ -like 'Write-*' } - __ | Should -Be $Commands.Count + $CommandCount = Get-Command | Measure-Object | Select-Object -ExpandProperty Count + __ | Should -Be $CommandCount Get-Command | Select-Object -First 1 -ExpandProperty Name | Should -Be '____' } From a515a4f1f0dbf95097629467ad359578a6732cf9 Mon Sep 17 00:00:00 2001 From: Devlin Cashman Date: Sat, 9 May 2020 14:03:55 -0400 Subject: [PATCH 8/9] Drive name typo --- PSKoans/Koans/Cmdlets 1/AboutPSProviders.Koans.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PSKoans/Koans/Cmdlets 1/AboutPSProviders.Koans.ps1 b/PSKoans/Koans/Cmdlets 1/AboutPSProviders.Koans.ps1 index 916228da4..6aedc5a63 100644 --- a/PSKoans/Koans/Cmdlets 1/AboutPSProviders.Koans.ps1 +++ b/PSKoans/Koans/Cmdlets 1/AboutPSProviders.Koans.ps1 @@ -134,7 +134,7 @@ Describe 'Environment Provider' { Describe 'FileSystem Provider' { BeforeAll { - $Path = 'TestDrive:' | Join-Path -ChildPath 'File001.tmp' + $Path = 'TEMP:' | Join-Path -ChildPath 'File001.tmp' $FileContent = @' PSKOANS! From 26acb71f4fe461c66c0b331aeac7dbffdf552b38 Mon Sep 17 00:00:00 2001 From: Devlin Cashman Date: Sat, 9 May 2020 14:21:22 -0400 Subject: [PATCH 9/9] easter egg --- PSKoans/Koans/Katas/ProcessingStrings.Koans.ps1 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/PSKoans/Koans/Katas/ProcessingStrings.Koans.ps1 b/PSKoans/Koans/Katas/ProcessingStrings.Koans.ps1 index 3f6de59f8..6a225d4cd 100644 --- a/PSKoans/Koans/Katas/ProcessingStrings.Koans.ps1 +++ b/PSKoans/Koans/Katas/ProcessingStrings.Koans.ps1 @@ -16,7 +16,14 @@ param() $String -split ',' # Creates an array by splitting the string Be sure to review AboutStrings, AboutArrays and the other foundation Koans - you've done so far if you get stuck or need help! + you've done so far if you get stuck! + + Testimonial: + "Can someone give me a hint on how to do this, I feel stupid." + -Puzzled PowerShell Newbie + + "I might have to steal this for a 'testimonials' section; that's exactly what the katas are meant for :D." + -Joel #> Describe "The Stock Challenge" { BeforeAll {