diff --git a/poshspec.psd1 b/poshspec.psd1 index 946f61f..e7df86b 100644 Binary files a/poshspec.psd1 and b/poshspec.psd1 differ diff --git a/poshspec.psm1 b/poshspec.psm1 index a5ce5d3..01c5d9e 100644 --- a/poshspec.psm1 +++ b/poshspec.psm1 @@ -35,60 +35,14 @@ function Get-PoshspecParam { ) $assertion = $Should.ToString().Trim() -<# - if ($PSBoundParameters.ContainsKey("Target")) - { - $Target = '`"' + $Target + '`"' - } - - if ($PSBoundParameters.ContainsKey("Property")) - { - $Property = "'" + $Property + "'" - } - - if ($PSBoundParameters.ContainsKey("Qualifier")) - { - $Qualifier = "'" + $Qualifier + "'" - } - - #$targetName = $Target - #> + if (-not $PSBoundParameters.ContainsKey("FriendlyName")) { $FriendlyName = $Target } $expressionString = $TestExpression.ToString() - <# - $expandedTokens = foreach ($token in $tokens) - { - if ($token.Type -eq 'Variable') - { - $variable = Get-Variable $token.Content -ErrorAction SilentlyContinue - if (-not [string]::IsNullOrEmpty($variable.Value)) - { - $value = "'" + $variable.Value + "'" - Write-Output -InputObject $value - } - else - { - Throw "Could not find a variable in scope by the name '$($token.Content)'" - } - } - else - { - if ($token.Type -eq 'String') { - Write-Output -InputObject ('"' + $token.Content + '"') - } else { - if ($token.Type -ne 'NewLine') { - Write-Output -InputObject $token.Content - } - } - } - } - - $expressionString = $expandedTokens -join " " - #> + if ($PSBoundParameters.ContainsKey("Property")) { $expressionString += " | Select-Object -ExpandProperty '$Property'"