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 +15
-5
lines changed
Modules/OperationValidation Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -296,11 +296,21 @@ param (
296
296
$moduleName = Split-Path - Path $module - Leaf
297
297
$manifestFile = Get-ChildItem - Path $module - Filter " $moduleName .psd1"
298
298
if (-not $manifestFile ) {
299
- # We may be in a "version" directory so get the actual module name from the parent directory
300
- $parent = (Split-Path - Path $module - Parent).Name
301
- $manifestFile = Get-ChildItem - Path $module - Filter " $parent .psd1"
299
+ if ($moduleName -as [version ]) {
300
+ # We are in a "version" directory so get the actual module name from the parent directory
301
+ $parent = (Split-Path - Path $module - Parent).Name
302
+ $manifestFile = Get-ChildItem - Path $module - Filter " $parent .psd1"
303
+ }
304
+ }
305
+
306
+ # Some OVF modules might not have a manifest (.psd1) file.
307
+ if ($manifestFile ) {
308
+ $manifest = Test-ModuleManifest - Path $manifestFile.FullName - Verbose:$false
309
+ }
310
+ else
311
+ {
312
+ $manifest = $null
302
313
}
303
- $manifest = Test-ModuleManifest - Path $manifestFile.FullName - Verbose:$false
304
314
305
315
if ( test-path - path $diagnosticsDir )
306
316
{
@@ -333,7 +343,7 @@ param (
333
343
Type = $dir
334
344
Name = $testName
335
345
ModuleName = $Module
336
- Version = [version ]$manifest.Version
346
+ Version = if ( $manifest .Version ) { [version ]$manifest.Version } else { $null }
337
347
Parameters = $parameters
338
348
}
339
349
New-OperationValidationInfo @modInfoParams
You can’t perform that action at this time.
0 commit comments