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
-
2
1
function Get-OperationValidation {
3
2
<#
4
3
. SYNOPSIS
@@ -159,6 +158,9 @@ function Get-OperationValidation {
159
158
[Alias (' PSPath' )]
160
159
[string []]$LiteralPath ,
161
160
161
+ # [Parameter(ParameterSetName = 'ModuleName')]
162
+ # [Parameter(ParameterSetName = 'Path')]
163
+ # [Parameter(ParameterSetName = 'LiteralPath')]
162
164
[ValidateSet (' Simple' , ' Comprehensive' )]
163
165
[string []]$TestType = @ (' Simple' , ' Comprehensive' ),
164
166
@@ -221,8 +223,11 @@ function Get-OperationValidation {
221
223
222
224
# Some OVF modules might not have a manifest (.psd1) file.
223
225
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
+ }
226
231
}
227
232
else
228
233
{
@@ -238,7 +243,7 @@ function Get-OperationValidation {
238
243
{
239
244
continue
240
245
}
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' } ))
242
247
{
243
248
# Pull out parameters to Pester script if they exist
244
249
$script = Get-Command - Name $file.fullname
You can’t perform that action at this time.
0 commit comments