diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 462af22..e25afda 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,3 +1,10 @@ +# Version 2.1.14 +* Improved handling of single quotes in Package function +* Added Functions for + * LocalUser + * AuditPolicy + * Volume + # Version 2.1.6 * Added Functions for * Firewall diff --git a/Tests/poshspec.Tests.ps1 b/Tests/poshspec.Tests.ps1 index b82ffd6..4774f0c 100644 --- a/Tests/poshspec.Tests.ps1 +++ b/Tests/poshspec.Tests.ps1 @@ -189,10 +189,10 @@ Describe 'Test Functions' { } It 'Should return a correct text expression' { - $results.Expression | Should Be "Get-Package -Name 'Microsoft Visual Studio Code' -ErrorAction SilentlyContinue | Should Not BeNullOrEmpty" + $results.Expression | Should Be 'Get-Package -Name "Microsoft Visual Studio Code" -ErrorAction SilentlyContinue | Select-Object -First 1 | Should Not BeNullOrEmpty' } } - + Context 'Package w/ properties' { $results = Package 'Microsoft Visual Studio Code' version { Should be '1.1.0' } @@ -202,7 +202,20 @@ Describe 'Test Functions' { } It 'Should return a correct text expression' { - $results.Expression | Should Be "Get-Package -Name 'Microsoft Visual Studio Code' -ErrorAction SilentlyContinue | Select-Object -ExpandProperty 'version' | Should be '1.1.0'" + $results.Expression | Should Be "Get-Package -Name ""Microsoft Visual Studio Code"" -ErrorAction SilentlyContinue | Select-Object -First 1 | Select-Object -ExpandProperty 'version' | Should be '1.1.0'" + } + } + + Context 'Package w/Single Quotes' { + + $results = Package "Name 'subname'" { Should Not BeNullOrEmpty } + + It 'Should return a correct test name' { + $results.Name | Should Be "Package 'Name 'subname'' Should Not BeNullOrEmpty" + } + + It 'Should return a correct text expression' { + $results.Expression | Should Be "Get-Package -Name ""Name 'subname'"" -ErrorAction SilentlyContinue | Select-Object -First 1 | Should Not BeNullOrEmpty" } } diff --git a/poshspec.psd1 b/poshspec.psd1 index 416d2e4..6715cff 100644 Binary files a/poshspec.psd1 and b/poshspec.psd1 differ