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

Commit a14dd2f

Browse files
committed
updates to the PSM1 to handle version specific directories. The current behavior is that if we find a Diagnostics directory in the root of the module, we'll use that otherwise, we'll hunt in the module base for version directories and take the most recent version.
1 parent 4521e8b commit a14dd2f

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Binary file not shown.

Modules/OperationValidation/OperationValidation.psm1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,26 @@ param (
210210
{
211211
if ( $modDir.Name -like $n )
212212
{
213+
# now determine if there's a diagnostics directory, or a version
213214
if ( test-path -path ($modDir.FullName + "\Diagnostics"))
214215
{
215216
$modDir.FullName
216217
break
217218
}
219+
$versionDirectories = Get-Childitem -path $modDir.FullName -dir |
220+
where-object { $_.name -as [version] }
221+
$potentialDiagnostics = $versionDirectories | where-object {
222+
test-path ($_.fullname + "\Diagnostics")
223+
}
224+
# now select the most recent module path which has diagnostics
225+
$DiagnosticDir = $potentialDiagnostics |
226+
sort-object {$_.name -as [version]} |
227+
Select-Object -Last 1
228+
if ( $DiagnosticDir )
229+
{
230+
$DiagnosticDir.FullName
231+
break
232+
}
218233
}
219234
}
220235
}

0 commit comments

Comments
 (0)