From f394039003fdf92f9691c238789e2d89135ea2fa Mon Sep 17 00:00:00 2001 From: Luke Duddridge Date: Fri, 10 Nov 2017 09:21:03 +0000 Subject: [PATCH 1/2] some people might put a space in btween the ){ declaring bit of the statement --- FourThingsToLearnPowerShell/Start-Demo.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FourThingsToLearnPowerShell/Start-Demo.ps1 b/FourThingsToLearnPowerShell/Start-Demo.ps1 index f0a16dd..63c40cd 100644 --- a/FourThingsToLearnPowerShell/Start-Demo.ps1 +++ b/FourThingsToLearnPowerShell/Start-Demo.ps1 @@ -103,7 +103,7 @@ NOTE: Start-Demo replaces the typing but runs the actual commands. } # else - if(($_lines[$_i] -match '\)' -and $_lines[$_i+1] -match '\{') -or ($_lines[$_i] -match '\){')) + if(($_lines[$_i] -match '\)' -and $_lines[$_i+1] -match '\{') -or ($_lines[$_i] -match '\)\s?{')) { $justKeepSwinging++ } From 6528ced1ad099e9ff9a00065f8692ae1718fd5fc Mon Sep 17 00:00:00 2001 From: Luke Duddridge Date: Tue, 14 Nov 2017 12:35:00 +0000 Subject: [PATCH 2/2] not sure if I updated the write one?!? --- Start-Demo.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Start-Demo.ps1 b/Start-Demo.ps1 index f0a16dd..63c40cd 100644 --- a/Start-Demo.ps1 +++ b/Start-Demo.ps1 @@ -103,7 +103,7 @@ NOTE: Start-Demo replaces the typing but runs the actual commands. } # else - if(($_lines[$_i] -match '\)' -and $_lines[$_i+1] -match '\{') -or ($_lines[$_i] -match '\){')) + if(($_lines[$_i] -match '\)' -and $_lines[$_i+1] -match '\{') -or ($_lines[$_i] -match '\)\s?{')) { $justKeepSwinging++ }