We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 83ec298 + f1edd5f commit 4c65936Copy full SHA for 4c65936
WindowsCompatibility/WindowsCompatibility.psm1
@@ -759,7 +759,7 @@ function Add-WindowsPSModulePath
759
)
760
761
$pathTable = [ordered] @{}
762
- $doUpdate = $false
+
763
foreach ($path in $paths)
764
{
765
if ($pathTable[$path])
@@ -770,14 +770,9 @@ function Add-WindowsPSModulePath
770
if ($PSCmdlet.ShouldProcess($path, "Add to PSModulePath"))
771
772
Write-Verbose -Verbose:$verboseFlag "Adding '$path' to the PSModulePath."
773
- $doUpdate = $true
+ $pathTable[$path] = $true
774
}
775
-
776
- $pathTable[$path] = $true
777
778
779
- if ($doUpdate)
780
- {
781
- $Env:PSModulePath = $pathTable.Keys -join [System.IO.Path]::PathSeparator
782
- }
+ $Env:PSModulePath = $pathTable.Keys -join [System.IO.Path]::PathSeparator
783
0 commit comments