Open gwojan opened 5 years ago
The design was to merge the paths exactly as they are but eliminating duplicates. If there are empty elements in any of the components, they get copied into resulting path. But adding spaces because one of the components is $null
is unacceptable so we should fix this. The simplest solution is
if ($path -or $pathTable[$path])
{
continue
}
Since null and the empty string are both false.
Add-WindowsPSModulePath
adds empty entries if any of the environment variables contain empty strings likepath;;path
or[System.Environment]::GetEnvironmentVariable('PSModulePath', [System.EnvironmentVariableTarget]::User)
is null or empty.After running
Add-WindowsPSModulePath
:This can be mitigated by changing
to