Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Commit 9029102

Browse files
committed
Fix casting "version" directory into [version] type
1 parent 678e067 commit 9029102

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Modules/OperationValidation/OperationValidation.psm1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ param (
256256

257257
$potentialDiagnostics = $versionDirectories | where-object {
258258
test-path ($_.fullname + "\Diagnostics")
259-
}
259+
}
260260
# now select the most recent module path which has diagnostics
261261
$DiagnosticDir = $potentialDiagnostics |
262262
sort-object {$_.name -as [version]} |
@@ -294,12 +294,12 @@ param (
294294

295295
# Get the module manifest so we can pull out the version
296296
$moduleName = Split-Path -Path $module -Leaf
297-
$manifestFile = Get-ChildItem -Path $module -Filter "$moduleName.psd1"
297+
$manifestFile = Get-ChildItem -Path $module -Filter "$($moduleName).psd1"
298298
if (-not $manifestFile) {
299-
if ($moduleName -as [version]) {
299+
if ("$moduleName" -as [version]) {
300300
# 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"
301+
$parent = Split-Path -Path (Split-Path -Path $module -Parent) -Leaf
302+
$manifestFile = Get-ChildItem -Path $module -Filter "$($parent).psd1"
303303
}
304304
}
305305

0 commit comments

Comments
 (0)