diff --git a/Modules/OperationValidation/Diagnostics/Comprehensive/PSGallery.Comprehensive.Tests.ps1 b/Modules/OperationValidation/Diagnostics/Comprehensive/PSGallery.Comprehensive.Tests.ps1 index fc6d949..7505168 100644 --- a/Modules/OperationValidation/Diagnostics/Comprehensive/PSGallery.Comprehensive.Tests.ps1 +++ b/Modules/OperationValidation/Diagnostics/Comprehensive/PSGallery.Comprehensive.Tests.ps1 @@ -1,4 +1,4 @@ -Describe "E2E validation of PSGallery" { +Describe "E2E validation of PSGallery" -fixture{ BeforeAll { $Repository = "InternalPSGallery" $ModuleName = "FormatTools" diff --git a/Modules/OperationValidation/Diagnostics/Simple/PSGallery.Simple.Tests.ps1 b/Modules/OperationValidation/Diagnostics/Simple/PSGallery.Simple.Tests.ps1 index f16b61a..b3128e0 100644 --- a/Modules/OperationValidation/Diagnostics/Simple/PSGallery.Simple.Tests.ps1 +++ b/Modules/OperationValidation/Diagnostics/Simple/PSGallery.Simple.Tests.ps1 @@ -1,4 +1,4 @@ -Describe "Simple Validation of PSGallery" { +Describe -name "Simple Validation of PSGallery" { It "The PowerShell Gallery should be responsive" { $request = [System.Net.WebRequest]::Create("http://psget/psgallery") $response = $Request.GetResponse() diff --git a/Modules/OperationValidation/OperationValidation.psm1 b/Modules/OperationValidation/OperationValidation.psm1 index dd697d2..5e36fc6 100644 --- a/Modules/OperationValidation/OperationValidation.psm1 +++ b/Modules/OperationValidation/OperationValidation.psm1 @@ -89,8 +89,19 @@ function Get-TestFromScript }, $true) | ForEach-Object { # This is the name of the 'describe' block - $describeName = ($_.CommandElements | Where-Object { $_.StaticType.name -eq 'string' })[1].SafeGetValue() - + for ($x = 0; $x -lt $_.CommandElements.Count; $x++) + { + #Name parameter is named + if ($_.CommandElements[$x] -is [System.Management.Automation.Language.CommandParameterAst] -and $_.CommandElements[$x].ParameterName -eq 'Name') + { + $describeName = $_.CommandElements[$x + 1].value + } + #if we have a string without a parameter name, return first hit. Name parameter is at position 0. + ElseIf (($_.CommandElements[$x] -is [System.Management.Automation.Language.StringConstantExpressionAst]) -and ($_.CommandElements[$x - 1] -is [System.Management.Automation.Language.StringConstantExpressionAst])) + { + $describeName = $_.CommandElements[$x].value + } + } $item = [PSCustomObject][ordered]@{ Name = $describeName Tags = @()