This repository was archived by the owner on Jun 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
OperationValidation/Public Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 1-
21function Get-OperationValidation {
32 <#
43 . SYNOPSIS
@@ -159,6 +158,9 @@ function Get-OperationValidation {
159158 [Alias (' PSPath' )]
160159 [string []]$LiteralPath ,
161160
161+ # [Parameter(ParameterSetName = 'ModuleName')]
162+ # [Parameter(ParameterSetName = 'Path')]
163+ # [Parameter(ParameterSetName = 'LiteralPath')]
162164 [ValidateSet (' Simple' , ' Comprehensive' )]
163165 [string []]$TestType = @ (' Simple' , ' Comprehensive' ),
164166
@@ -221,8 +223,11 @@ function Get-OperationValidation {
221223
222224 # Some OVF modules might not have a manifest (.psd1) file.
223225 if ($manifestFile ) {
224- $manifest = Parse- Psd1 $manifestFile.FullName
225- # $manifest = Test-ModuleManifest -Path $manifestFile.FullName -Verbose:$false -ErrorAction SilentlyContinue
226+ if ($PSVersionTable.PSVersion -ge 5 ) {
227+ $manifest = Import-PowerShellDataFile - Path $manifestFile.FullName
228+ } else {
229+ $manifest = Parse- Psd1 $manifestFile.FullName
230+ }
226231 }
227232 else
228233 {
@@ -238,7 +243,7 @@ function Get-OperationValidation {
238243 {
239244 continue
240245 }
241- foreach ($file in (Get-ChildItem - Path $testDir - Filter * .tests.ps1))
246+ foreach ($file in (Get-ChildItem - Path $testDir | Where-Object { $_ .Name -like ' *.tests.ps1' } ))
242247 {
243248 # Pull out parameters to Pester script if they exist
244249 $script = Get-Command - Name $file.fullname
You can’t perform that action at this time.
0 commit comments