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

Commit ffdcfd3

Browse files
My-Random-Thoughtsdevblackops
authored andcommitted
(GH32) Trim semicolons (;) from $env:PSModulePath before splitting
If $env:PSModulePath starts or ends with semicolons (;) then splitting on it will produce $null entries. This will cause problems when looping through each path to search for OVF modules.
1 parent b2adeae commit ffdcfd3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

OperationValidation/Private/Get-ModuleList.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function Get-ModuleList {
1212

1313
if ($PSCmdlet.ParameterSetName -eq 'Name')
1414
{
15-
$pathsToSearch = $env:PSModulePath.Split(';')
15+
$pathsToSearch = $env:PSModulePath.Trim(';').Split(';')
1616
}
1717
elseIf ($PSCmdlet.ParameterSetName -eq 'Path')
1818
{

0 commit comments

Comments
 (0)